Professional Documents
Culture Documents
clf;
N=40;
Y=impz (Num,Den,N);
stem(Y);
ylabel('amplitude');
title('Impulse Response');
grid;
Output:
CONVOLUTION PROCESS
Source Code:
n=0:40;
a=2;b=-3;
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
x=(a*x1)+(b*x2);
yt=(a*y1)+(b*y2);
subplot(3,1,1);stem(n,y);
ylabel('amplitude');
subplot(3,1,2);stem(n,yt);
ylabel('Amplitude');title('weighed output');
subplot(3,1,3);stem(n,d);
Output:
output due to weighed input
20
amplitude
0
-20
-40
0 5 10 15 20 25 30 35 40
weighed output
50
Amplitude
-50
0 5 10 15 20 25 30 35 40
-15
x 10 difference signal
5
-5
0 5 10 15 20 25 30 35 40
time index n
Source Code:
output y[n]
20
Amplitude 0
-20
-40
0 5 10 15 20 25 30 35 40
output due to delayed input
50
Amplitude
-50
0 5 10 15 20 25 30 35 40
Difference signal
1
amplitude
-1
0 5 10 15 20 25 30 35 40
time index n
y=filter (num,den,x,ic);
y3=(a*y1)+(b*y2);d=y-y3;
subplot(3,1,1);stem(n,y);
subplot (3,1,3);stem(n,d);
-50
0 5 10 15 20 25 30 35 40
time domain representation
weighed output
50
amplitude
-50
0 5 10 15 20 25 30 35 40
Time Index n
-15
x 10 Difference signal
5
amplitude
-5
0 5 10 15 20 25 30 35 40
time index n