Professional Documents
Culture Documents
To Write A MATLAB Program To Find The Total Response of A System Defined by A Difference Equation
To Write A MATLAB Program To Find The Total Response of A System Defined by A Difference Equation
%Let the difference equation be y(n)-y(n-1)+0.9y(n-2)=x(n) %To plot the impulse and step response for n = -20.-19,....100 clc; %Clear the command window
%Generating the impulse response x=[n==0]; y=filter(b,a,x); subplot(2,1,1) stem(n,y,'.') xlabel('Values of N') ylabel('h(n)') title('Impulse response') %Generating the step response x=[n>=0]; y=filter(b,a,x); subplot(2,1,2) stem(n,y,'.') xlabel('Values of N') ylabel('s(n)') title('Step response') COMMAND WINDOW OUTPUT ::PROGRAM TO FIND THE TOTAL RESPONSE FROM THE DIFFERENCE EQUATION::>
The values for the total response for given differential equation are ::4 13 24 31 -42
calculated