summaryrefslogtreecommitdiff
path: root/2279/CH7/EX7.6/eg_7_6.sce
blob: c313d8a1286fa83581f8c761689266dbc279a625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//DTFS of a periodic sequence
clc
clear
close
n=-4:3;
x=[0 1 2 3 0 1 2 3];
N=4;
k=0:3;;
wo=2*%pi/N;
a0=1.5;
a1=-0.5+0.5*%i;
a2=-0.5;
a3=-0.5-0.5*%i;
a=[a0,a1,a2,a3]
for i=1:length(a)
    phase(i)=atan(imag(a(i))/real(a(i)));    
end
subplot(2,1,1)
plot(k,abs(a),'.');
xtitle("magnitude spectrum","k","ak");
subplot(2,1,2)
plot(k,phase,'.');
xtitle("phase spectrum","k","ak");