summaryrefslogtreecommitdiff
path: root/40/CH5/EX5.3d/Exa_5_3d.sce
blob: e35c519566c6085fb883be0c03fa73af9500f2db (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
//DTFT of x[n]=a^abs(n)
a=0.5;
n=-9:9;
x=a^abs(n);
//Discrete time Fourier Transform
k=0:(4/1000):4;
w=(2*%pi*k)/4;
xw=x*exp(%i*n'*w);
xw_mag=real(xw);
w=[-mtlb_fliplr(xw_mag),w(2:1001)];
xw_mag=[mtlb_fliplr(xw_mag),xw_mag(2:1001)];
figure
subplot(2,1,1);
a=gca();
a.x_location="origin";
a.y_location="origin";
plot2d3('gnn',n,x);
xtitle('discrete time sequence x[n]');
subplot(2,1,2);
a=gca();
a.x_location="origin";
a.y_location="origin";
plot2d(w,xw_mag);
title('discrete time fourier transform x(exp(jw))');