summaryrefslogtreecommitdiff
path: root/67/CH2/EX2.59/example259.sce
blob: 2661f9b75a9040ad91906a5c92668e358b0f5ddc (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
28
29
30
31
32
//Example 2.59
clc;
n=-8:1:8;
for i=1:length(n)
    if n(i)<0 then
        x(i)=0;
        h(i)=0;
    else
         x(i)=1;
         h(i)=2^n(i);
    end
end
y=convol(x,h);
figure
a=gca();
plot2d3(n,h);
a.x_location='origin';
a.y_location='origin';
title('Impulse responce');
figure
a=gca();
plot2d3(n,x);
a.x_location='origin';
a.y_location='origin';
title('Input signal');
figure
a=gca();
n1=-16:1:16
plot2d3(n1,y);
a.x_location='origin';
a.y_location='origin';
title('Output signal');