summaryrefslogtreecommitdiff
path: root/716/CH9/EX9.5/Solved_Ex9_5.sce
diff options
context:
space:
mode:
Diffstat (limited to '716/CH9/EX9.5/Solved_Ex9_5.sce')
-rwxr-xr-x716/CH9/EX9.5/Solved_Ex9_5.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/716/CH9/EX9.5/Solved_Ex9_5.sce b/716/CH9/EX9.5/Solved_Ex9_5.sce
new file mode 100755
index 000000000..6b6df0969
--- /dev/null
+++ b/716/CH9/EX9.5/Solved_Ex9_5.sce
@@ -0,0 +1,16 @@
+//compute 8 point DFT of x(n)={2 2 2 2 1 1 1 1}
+clc;
+clear;
+n=0:1:7;//for 8 point DFT
+x=[2 2 2 2 1 1 1 1];
+disp(x,'Given signal=> x(n)=');
+X=fft(x);
+disp(X,'8 point FFT of x(n)=>');
+disp(abs(X),'magnitude of 8 point FFT x(n)=>');
+disp(atan(imag(X),real(X)),'phase of 8 point FFT x(n)=>');
+subplot(1,2,1)
+plot2d3(n,abs(X),2);
+xtitle('Magnitude Spectrum','k','|X(k)|');
+subplot(1,2,2)
+plot2d3(n,atan(imag(X),real(X)),2);
+xtitle('Phase Spectrum','k','angle(X(k))');