EXPERIMENT - 12


AIM

To find 8 point Discrete Fourier Transform of a Signal and verify it analytically .

THEORY

The discrete Fourier transform (DFT) converts a finite sequence of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their frequencies, that has those same sample values. It can be said to convert the sampled function from its original domain (often time or position along a line) to the frequency domain.

The Sequence is 2,1,1,3,2,1,2,0{2 , -1, 1, 3, -2, 1 , 2 , 0}.

MATLAB COMMANDS USED

* plot(x,y,color,properties)
* fft(t);
* stem(x);
* imag(x);
* real(x)

MATLAB CODE

clear;
x=[ 2     -1     1     3     -2     1     2    0];
subplot(2,2,1)
stem(x,'b','filled');
grid on;
axis([0 9 -3 4 ]);
title({'Sequence X(n): ';num2str(x)});
xlabel('Sample Number (n)')
ylabel('Value');

y=fft(x,8);
real_y=real(y);
imag_y=imag(y);

subplot(2,2,2)
stem(real_y,'o','filled');
grid on;
axis([0 9 min(real_y)-1 max(real_y)+1]);
title({'Real part of 8-point DFT:
';num2str(round(real_y*10)/10)});
xlabel('Sample Number (n)')
ylabel('Value of Real part');

plot3=subplot(2,2,3)
stem(imag_y,'o','filled');
plot3.XTickMode='auto';
grid on;
axis([0 9 min(imag_y)-1 max(imag_y)+1]);
title('hooola')
title({'Imaginary part of 8-point DFT 
of Sequence X(n) ';
num2str(round(imag_y*10)/10)});
xlabel('Sample Number (n)')
ylabel('Value of Imaginary part ');

inverse_y=ifft(y,8);
plot4=subplot(2,2,4)
stem(inverse_y,'o','filled');
grid on;
axis([0 9 min(inverse_y)-1 max(inverse_y)+1]);
title({'IInvesre of 8-point DFT:
';num2str(round(inverse_y*10)/10)});
xlabel('Sample Number (n)')
ylabel('Value  ');

print('DFT_sequence','-dpng');

RESULT

The 8 point Discrete Fourier Transform of a Signal has been found and verified analytically .