Impulse Response of X
Impulse Response of X
Impulse Response of X
THEORY:
1. x[n]=[1 1 2 -1]
h[n]=[1 1 1 1]
Find Y[n]
CODE:
x=[1 1 2 -1]
h=[1 1 1 1]
n=0:2:6
subplot(3,1,1)
stem(n,x)
title('impulse response of x')
subplot(3,1,2)
stem(n,h)
title('impulse response of h')
y=conv(x,h)
l1=length(x)
l2=length(h)
N=l1+l2-1
n=0:1:N-1
subplot(3,1,3)
stem(n,y)
title('convolution impulse response')
1
impulse response of x
2
-2
0 1 2 3 4 5 6
impulse response of h
1
0.5
0
0 1 2 3 4 5 6
convolution impulse response
5
-5
0 1 2 3 4 5 6
2. x(n)=[1 1 1 1]
h(n)=2^n [n=4]
Find y(n).
CODE:
x=[1 1 1 1]
n=1:1:4
h=power(2,n)
n=0:2:6
subplot(3,1,1)
stem(n,x)
title('impulse response of x')
subplot(3,1,2)
stem(n,h)
title('impulse response of h')
y=conv(x,h)
l1=length(x)
l2=length(h)
N=l1+l2-1
n=0:1:N-1
subplot(3,1,3)
stem(n,y)
title('convolution impulse response')
2
impulse response of x
1
0.5
0
0 1 2 3 4 5 6
impulse response of h
20
10
0
0 1 2 3 4 5 6
convolution impulse response
40
20
0
0 1 2 3 4 5 6
CONCLUSION- We are observed and plot the impulse response of the system. We know
that CONV and LENGTH function.