Algorithm
In general, any difference equation is represented as: y(n)+a1y(n-1)+a2y(n-2)+......=b0x(n)+b1x(n-1)+........
- Input the coefficients of x(n)
- Input the coefficients of y(n)
- Input the sequence x(n)
- Find the solution of the equation using MATLAB command "filter(b,a,x)" where b is the coefficients of x(n),a is the coefficients of the y(n) and x is the input sequence x(n)
- Display the solution
Program
% program to solve a given differential equation which represents an LTI system
b=input('Enter the coefficients of x(n)');
a=input('Enter the coefficients of y(n)');
x=input('Enter the input sequence x(n)');
y=filter(b,a,x); % solve the given equation
disp(y); %display the solution
No comments:
Post a Comment
Your Comments... (comments are moderated)