Implementing DFT in MATLAB

x = input('Enter the sequence');
n = input('Enter the length');
y = fft(x,n);
stem(y);
title('Discrete fourier transform');
xlabel('Real axis');
ylabel('Imaginary Axis');

Output

Enter the sequence[0.25 0.25 0.25 0]
Enter the length4
Output

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.