summaryrefslogtreecommitdiff
path: root/692/CH3/EX3.5/P3_5.sce
blob: 0a949b858507a6d348571532bdb0ee58b188fa05 (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
//EXAMPLE 3.5
//DTFT of unit sample sequence
clc;
clear;
//a=0.5;
n=0:9;
x = [1,zeros(1,9)];
disp(x,'x[n] = ')

K = 4;
k = 0:4/1000:4;
W = k*2*%pi/K;
X = (x)*exp(%i*n'*W);
disp(X,'DTFT,x[n] --> ')
X_mag   = abs(X);
X_phase = phasemag(X);//no phase exists

figure(0);
plot2d3(mtlb_fliplr(W),X_mag);
xtitle('Magnitude plot','W --->','X_mag --->');
figure(1);
plot2d3(mtlb_fliplr(W),X_phase);
xtitle(' zero phase plot','W --->','X_phase --->');