This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Purdue University: ECE438 - Digital Signal Processing with Applications 1 ECE438 - Laboratory 6: Discrete Fourier Transform and Fast Fourier Transform Algorithms (Week 2) October 6, 2010 1 Introduction This is the second week of a two week laboratory that covers the Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT). The first week introduced the DFT and associated sampling and windowing effects. This laboratory will continue the discussion of the DFT and will introduce the FFT. 2 Continuation of DFT Analysis This section continues the analysis of the DFT started in the previous weeks laboratory. (DFT) X N ( k ) = N- 1 summationdisplay n =0 x ( n ) e- j 2 kn/N (1) (inverse DFT) x ( n ) = 1 N N- 1 summationdisplay k =0 X N ( k ) e j 2 kn/N (2) 2.1 Shifting the Frequency Range In this section, we will illustrate a representation for the DFT of equation (1) that is a bit more intuitive. First create a Hamming window x of length N = 20, using the Matlab command x = hamming(20) . Then use your matlab function DFTsum to compute the 20 point DFT of x . Plot the magnitude of the DFT, | X 20 ( k ) | , versus the index k . Remember that the DFT index k starts at 0 not 1! INLAB REPORT: Hand in the plot of the | X 20 ( k ) | . Circle the regions of the plot corresponding to low frequency components. Questions or comments concerning this laboratory should be directed to Prof. Charles A. Bouman, School of Electrical and Computer Engineering, Purdue University, West Lafayette IN 47907; (765) 494- 0340; email@example.com Purdue University: ECE438 - Digital Signal Processing with Applications 2 Our plot of the DFT has two disadvantages. First, the DFT values are plotted against k rather then the frequency . Second, the arrangement of frequency samples in the DFT goes from 0 to 2 rather than from- to , as is conventional with the DTFT. In order to plot the DFT values similar to a conventional DTFT plot, we must compute the vector of frequencies in radians per sample, and then rotate the plot to produce the more familiar range,- to . Lets first consider the vector w of frequencies in radians per sample. Each element of w should be the frequency of the corresponding DFT sample X ( k ), which can be computed by = 2 k/N k [0 ,...,N- 1] . (3) However, the frequencies should also lie in the range from- to . Therefore, if , then it should be set to - 2 . An easy way of making this change in Matlab 5.1 is w(w>=pi) = w(w>=pi)-2*pi . The resulting vectors X and w are correct, but out of order. To reorder them, we must swap the first and second halves of the vectors. Fortunately, Matlab provides a function specifically for this purpose, called fftshift ....
View Full Document