summaryrefslogtreecommitdiff
path: root/40/CH8/EX8.11/Exa_8_11.sce
blob: 77698dfeaacfc44280b103019470349929496094 (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
//Effects of leakage
n1=0:0.005:0.1;
n2=0:0.005:0.125;
n3=0:0.005:1.125;
xt1=(2*cos(20*%pi*n1')+5*cos(100*%pi*n1'));
xt2=(2*cos(20*%pi*n2')+5*cos(100*%pi*n2'));
xt3=(2*cos(20*%pi*n3')+5*cos(100*%pi*n3'));
XDFS1=abs(fft(xt1,-1))/20;
XDFS2=abs(fft(xt2,-1))/25;
XDFS3=abs(fft(xt3,-1))/225;
f1=0:5:100;
f2=0:4:100;
f3=0:100/225:100;
a=gca();
a.x_location="origin";
plot2d3('gnn',f1,XDFS1);
xlabel('analog frequency');
ylabel('Magnitude');
xset('window',1);
subplot(211);
plot2d3('gnn',f2,XDFS2);
xlabel('analog frequency');
ylabel('Magnitude');
subplot(212);
plot2d3('gnn',f3,XDFS3);
xlabel('analog frequency');
ylabel('Magnitude');