Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Example:

Given the following difference equation:

y (n) y (n 1) + 0.9 y (n 2) = x(n)

a.
b.
c.

Calculate and plot the impulse response


Calculate and plot the unit step response
Is the system specified by h(n) stable?

Solution:

%Impulse 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('Impulse response');xlabel('n');ylabel('h(n)');

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.

The impulse response of h(n) is getting zero for n>120.


To find system is stable, we need to calculate

h( n)

Therefore

>>sum(abs(h))
ans =
14.8785
which implies that system is stable.

ECE 308-2

You might also like