summaryrefslogtreecommitdiff
path: root/3812/CH2/EX2.19.a/2_19_a.sce
blob: 486a6bba9b65f1a5b7ecaa7264de5ae167ddea77 (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
//Example 2_19 <a>
//compute the Convolution of x[n] and Unit Impulse response h[n]
clear;
close;
clc;
Max_Limit=10;
for n=1:Max_Limit
Alpha=0.5;
h=ones(1,Max_Limit);
N1=0:Max_Limit-1;
x(n)=1;
end
N2=0:Max_Limit-1;
y=convol(x,h);
N=0:2*Max_Limit-2;
figure
a=gca();
plot2d3('gnn',N2,x) 
xtitle('Input Response Fig 2.5.(a)','n','x[n]');
a.thickness=2;
figure
a=gca();
plot2d3('gnn',N(1:Max_Limit),y(1:Max_Limit),5) 
xtitle('Output Response Fig 2.7','n','y[n]');
a.thickness=2;