summaryrefslogtreecommitdiff
path: root/40/CH8/EX8.9b/Exa_8_9b.sce
blob: d32e7094cfbb667d3cfc32f118f8b39513de8ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//DFT and DFS of sinusoids
n2=0:1/1280:31/128;
xt=4*sin(72*%pi*n2');
n=0:1/128:31/128;//F=9/32 hence N=32
xn=4*sin(72*%pi*n');
XDFT=abs(dft(xn,-1));
n1=0:31;
a=gca();
a.x_location="origin";
plot2d(n2,xt);
plot2d3('gnn',n,xn);
xset('window',1);
b=gca();
b.x_location="origin";
plot2d3('gnn',n1,XDFT);