ELEC 320, Fall 1998
Prof. Rich Kozick

Laboratory 7

Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT)


The development of the FFT algorithm for computing the DFT is one of the primary reasons that digital signal processing (DSP) is so common today. This lab provides a brief introduction to the DFT and FFT. The DFT and FFT are discussed in Chapter 6 of the Kamen/Heck text.

What are the DFT and FFT?

The DFT provides the Fourier transform of sampled (discrete-time) data. Similar to the continuous-time Fourier transform that we studied in class, the DFT describes the frequency content of discrete-time signals. The FFT is a fast way to compute the DFT: the FFT and DFT produce identical results, but the FFT requires less computation. Further details about the DFT and FFT will be provided during lab.

Exercises:

  1. Please download the sound file hw1data.au to your directory from the Web page for this lab assignment. Read the file into Matlab, listen to it, and take the FFT with the commands:

    x = auread('hw1data.au');
    sound(x)
    X = fft(x);

    The sampling rate for this signal is 8192 samples per second. You can plot the FFT magnitude versus Hertz with the MATLAB commands given below. Make sure that you understand what these commands are doing - you will have some homework exercises next week that will use MATLAB and the FFT.

    Fs = 8192;
    N = length(X);
    f = (0:N-1)'/N*Fs;
    plot(f, abs(X))

    Which frequency (in hertz) appears to be dominant? (The imzoom command is useful to zoom-in on a figure.) Do harmonics appear to be present? Can you guess what produced this sound?

  2. Some signals change their frequency content over time. An example is shown in this item, along with a tool for signal analysis called the spectrogram that is generated using the FFT.

    Download the sound file chirp.au to your account, and read it into MATLAB with the commands:


    x = auread('chirp.au');
    sound(x)

    The sampling rate for this data is 8192 samples per second. Listen to the sound, then view the FFT of the signal (with the frequency axis labeled in Hertz), and then view the spectrogram in MATLAB with the command:

    specgram(x, 512, 8192, 256, 1);

    (You may have to exit Netscape to properly view the colors in the spectrogram.)

    What is different between the FFT results and the spectrogram results? Use the help command in Matlab for more details about the arguments to the specgram command. Try to relate the spectrogram to the sound that you hear.

    The spectrogram is computed by performing the FFT on subsets of the data. The intent of this exercise is to show you an application of the FFT in signal analysis.

Thank you.