blob: 2d5d4b294ed32320b8d28ae03dec5c9c17eb915d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//DFT and DFS of sinusoids
n2=0:1/2400:23/240;
xt=1+4*sin(120*%pi*n2')+4*sin(40*%pi*n2');
n=0:1/240:23/240;//F=9/32 hence N=32
xn=1+4*sin(120*%pi*n')+4*sin(40*%pi*n');
XDFT=abs(dft(xn,-1));
n1=0:23;
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);
|