summaryrefslogtreecommitdiff
path: root/62/CH6/EX6.50/ex_6_50.sce
blob: 7234437d973ed097f82192a04e8b799afbb8bd04 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
close;
clc;
clear;
n=0:3;
x=cos(%pi*n/2);
subplot(4,1,1)
plot2d3(n,x)
xtitle('x[n]','n')
a=gca();
a.x_location="origin";
a.y_location="right";
poly1=a.children.children;
poly1.thickness=3;
poly1.foreground=2;
plot(n,x,'r.')
subplot(4,1,2)
h=.5^n;
plot2d3(n,h);
xtitle('h[n]','n')
a=gca();
a.x_location="origin";
a.y_location="right";
poly1=a.children.children;
poly1.thickness=3;
poly1.foreground=2;
plot(n,h,'r.')
y=convol(x,h)
subplot(4,1,3)
plot2d3(n,y(1:4));
xtitle('y[n]','n')
plot(n,y(1:4),'r.')
a=gca();
a.x_location="origin";
a.y_location="right";
poly1=a.children.children;
poly1.thickness=3;
poly1.foreground=2;
clear y;
X=dft(x,-1);
H=dft(h,-1);
Y=H.*X;
y=dft(Y,1);
subplot(4,1,4)
plot2d3(n,y);
xtitle('y[n]','n')
plot(n,y,'r.')
a=gca();
a.x_location="origin";
a.y_location="right";
poly1=a.children.children;
poly1.thickness=3;
poly1.foreground=2;
plot(n,x,'r.')