Professional Documents
Culture Documents
Difference Equation Using Matlab
Difference Equation Using Matlab
a.
b.
c.
Solution:
ECE 308-1
b.
%unit response of y(n)-y(n-1)+0.9y(n-2)=x(n)difference equation
b=[1];
a=[1,-1,0.9];
n=[-20:120];x=[(n-0)>=0];
h=filter(b,a,x);
stem(n,h);
title('Unit response'); xlabel('n'); ylabel('h(n)');
c.
h( n)
Therefore
>>sum(abs(h))
ans =
14.8785
which implies that system is stable.
ECE 308-2