From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 716/CH9/EX9.5.m/MatLab_Prog9_5.sce | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 716/CH9/EX9.5.m/MatLab_Prog9_5.sce (limited to '716/CH9/EX9.5.m/MatLab_Prog9_5.sce') diff --git a/716/CH9/EX9.5.m/MatLab_Prog9_5.sce b/716/CH9/EX9.5.m/MatLab_Prog9_5.sce new file mode 100755 index 000000000..2c20ecc8d --- /dev/null +++ b/716/CH9/EX9.5.m/MatLab_Prog9_5.sce @@ -0,0 +1,21 @@ +//Perform 4 point DFT of x(n)=(1 1 2 3) using FFT and sketch magnitude and phase spectrum +clc; +clear; +N=4; +xn=[1 1 2 3] +Xk=fft(xn); +wk=0:1:N-1; +disp(Xk,'16 point DFT of x(n)=>'); +disp(abs(Xk),'magnitude of 16 point DFT x(n)=>'); +disp(atan(imag(Xk),real(Xk)),'phase of 16 point DFT x(n)=>'); +plot2d3(wk,xn,2); +isoview(0,5,0,3); +xset('window',1); +subplot(1,2,1) +plot2d3(wk,abs(Xk),2); +isoview(0,5,0,5); +xtitle('Magnitude Spectrum','k','|X(k)|'); +subplot(1,2,2) +plot2d3(wk,atan(imag(Xk),real(Xk)),2); +isoview(0,5,-5,5); +xtitle('Phase Spectrum','k','angle(X(k))'); \ No newline at end of file -- cgit