Student Seminar Report & Project Report With Presentation (PPT,PDF,DOC,ZIP)

Full Version: SOLUTION OF DIFFERENCE EQUATION WITHOUT INITIAL CONDITIONS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Procedure:-
1. Rewrite the given difference equation to have only the output terms on the LHS and input terms to be on RHS
2. Create a Matrix of Y coefficients, a
3. Create a Matrix of X coefficients, b
4. Generate the input sequence x(n)
5. Find the output of the system for the input sequence x(n)
6. Plot the input and the output

MATLAB program for difference equation without initial condition
Code:
clear
close all
clc

% THE INPUT SEQUENCE IS X(N) = U(N)
% THE DIFFERENCE EQUATION IS Y(N) – 0.9Y(N-1)= X(N)
% NUMERATOR POLYNOMIAL IS 'A' AND DENOMINATOR POLYNOMIAL IS 'B'

b = [1];
a = [1 -0.9];
% N -TIME INDEX
n = [0:20];
% GENERATE THE INPUT SEQUENCE X(N)
x = [( n >= 0)];
% FIND THE OUTPUT OF THE SYSTEM FOR THE INPUT SEQUENCE X(N)
y = filter(b,a,x);
% PLOT THE INPUT AND THE OUTPUT
subplot(2,1,1);
stem(n,x);
xlabel('n --> ');
ylabel('x --> ');
title('Input sequence x(n)');
grid on;

subplot(2,1,2);
stem(n,y);
xlabel('n --> ');
ylabel('y --> ');
title('Output sequence y(n)');
grid on;

RESULT:- DIFFERENCE EQUATION WITHOUT INITIAL CONDITIONS