blob: 4d1910fe4884938b9b59422ab08eeae9ea909255 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
//Example 2_17
//find convolution of two sequences
clc;
n=-8:1/1000:8;
for i=1:length(n)
if n(i)<-5 then
x(i)=0;
else
x(i)=(1/2)^n(i);
end
if n(i)<3 then
h(i)=0;
else
h(i)=(1/3)^n(i);
end
end
y=convol(x,h);
figure
plot2d3(n,h);
title('Impulse responce');
figure
plot2d3(n,x);
title('Input signal');
figure
n1=-16:1/1000:16
plot2d3(n1,y);
title('Output signal');
|