COMPUTATION OF N-POINT DFT
#1

Procedure:-
1) Enter the number of points, N
2) Enter the input sequence elements, x[n]
3) Create a vector for the sample index, ’n’
4) Initialize loop variable, ‘k’ for the DFT samples X(k)
5) Calculate the twiddle factor for each ‘k’
6) Multiply x[n] and the twiddle factors , elements-by-element
7) Sum all the products, assign to X(k)
8) Plot the magnitude and phase spectrum
9) Verify the results with built in function
MATLAB program for DFT
Code:
clear
clc
close all
% ENTER THE NUMBER OF POINTS
N = 6
% ENTER THE SEQUENCE IS x WITH TIME INDEX n
x = [1 1 2 2 3 3];
n = 0:N-1;
% COMPUTE DFT
for k = 0:N-1
    W = exp(-j*2*pi*k*n/N)
    dotprod = x.*W;
    X(k+1) = sum(dotprod)
end

% PLOT THE MAGNITUDE SPECTRUM
subplot(2,1,1);
stem(n,abs(X));
xlabel('n-->');
ylabel('magnitude-->');
grid on;

% PLOT THE PHASE SPECTRUM
subplot(2,1,2);
stem(n,angle(X));
xlabel('n-->');
ylabel('angle-->');
grid on;

% VERIFICATION OF THE IMPLIMENTATION
verify = fft(x,N);
figure
% PLOT THE MAGNITUDE SPECTRUM
subplot(2,1,1);
stem(n,abs(verify));
xlabel('n-->');
ylabel('magnitude-->');
grid on;

% PLOT THE PHASE SPECTRUM
subplot(2,1,2);
stem(n,angle(verify));
xlabel('n-->');
ylabel('angle-->');
grid on;

RESULT:-COMPUTATION OF DFT
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: c program for dft, matlab code for image watermarking using dft, how to find n point dft, advantages of fft over dft ppt, dft code for matlab, dft idft using convolution, c source code for dft precoding,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  CIRCULAR CONVOLUTION OF TWO FINITE LENGTH SEQUENCES USING DFT AND IDFT seminar class 1 9,459 21-11-2012, 12:18 PM
Last Post: seminar details
  COMPUTATION OF N POINT DFT OF A GIVEN SEQUENCE seminar class 0 1,832 06-05-2011, 03:52 PM
Last Post: seminar class
  LINEAR CONVOLUTION OF TWO FINITE LENGTH SEQUENCES USING DFT AND IDFT seminar class 0 3,322 06-05-2011, 03:40 PM
Last Post: seminar class

Forum Jump: