summaryrefslogtreecommitdiff
path: root/40/CH8/EX8.6/Exa_8_6.sce
blob: 2b63a0678644524fabe995c0bf0b83da76b2e911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//Signal and spectrum replication
xn=[2 3 2 1];
XDFT=fft(xn,-1)
yn=[xn xn xn];
YDFT=fft(yn,-1)
YDFT1=3*[XDFT(1:1/3:length(XDFT))];
for i=2:3
    YDFT1(i:3:length(YDFT1))=0;
end
YDFT1(12:-1:11)=0;
disp(YDFT1,'the DFT of x[n/3] is');
hn=[xn(1:1/3:length(xn))]
for i=2:3
    hn(i:3:length(hn))=0;
end
hn(12:-1:11)=0;
hn
HDFT=fft(hn,-1)
HDFT1=[XDFT;XDFT;XDFT];
disp(HDFT1,'the DFT of y[n]=[x[n],x[n],x[n]] is');