02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

156 Chapter 5 THE DISCRETE FOURIER TRANSFORM<br />

5.3.1 MATLAB IMPLEMENTATION<br />

It is clear from the discussions at the top of this section that the DFS is<br />

practically equivalent to the DFT when 0 ≤ n ≤ N − 1. Therefore the<br />

implementation of the DFT can be done in a similar fashion. If x(n) and<br />

X(k) are arranged as column vectors x and X, respectively, then from<br />

(5.24) and (5.25) we have<br />

X = W N x<br />

x = 1 N W∗ N X (5.26)<br />

where W N is the matrix defined in (5.7) and will now be called a DFT<br />

matrix. Hence the earlier dfs and idfs MATLAB functions can be renamed<br />

as the dft and idft functions to implement the discrete Fourier<br />

transform computations.<br />

function [Xk] = dft(xn,N)<br />

% Computes Discrete Fourier Transform<br />

% -----------------------------------<br />

% [Xk] = dft(xn,N)<br />

% Xk = DFT coeff. array over 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!