summaryrefslogtreecommitdiff
path: root/716/CH9/EX9.5/Solved_Ex9_5.sce
blob: 6b6df0969479061f8be0e6601ea247684e570d61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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))');