%lab2
%#1b
clear;
a0=1;
a1=0;
a2=-0.5;

b0=1.2;
b1=1.2;
b2=0.6;

a=[a0,a1,a2];       
b=[b0,b1,b2];      

n=[0:60]';
x=zeros(size(n));   
index=find(n==0);
x(index)=1;

y=filter(b,a,x);

subplot(2,1,1)
stem(n,x,'b')
grid 
xlabel('n')
ylabel('Amplitude')
title('X(n)= impulse Signal input')

subplot(2,1,2)
stem(n,y,'r')
grid
xlabel('n')
ylabel('Amplitude')
title('Y(n) - Impulse Response')
 
