From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 40/CH8/EX8.6/Exa_8_6.sce | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to '40/CH8/EX8.6/Exa_8_6.sce') diff --git a/40/CH8/EX8.6/Exa_8_6.sce b/40/CH8/EX8.6/Exa_8_6.sce index be5c3cbb9..2b63a0678 100755 --- a/40/CH8/EX8.6/Exa_8_6.sce +++ b/40/CH8/EX8.6/Exa_8_6.sce @@ -1,20 +1,20 @@ -//Signal and spectrum replication -xn=[2 3 2 1]; -XDFT=dft(xn,-1) -yn=[xn xn xn]; -YDFT=dft(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=dft(hn,-1) -HDFT1=[XDFT;XDFT;XDFT]; +//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'); \ No newline at end of file -- cgit