ELEC 320, Fall 2006
Profs. Wismer & Kozick

## Laboratory 8: 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 5 of the Lathi 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 will study 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 are available in notes at the following link:
Notes on the DFT and FFT

#### 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:

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 to do in a few weeks 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? Do harmonics appear to be present? Can you guess what produced this sound?

2. Generate a periodic signal of pulses using the function generator. Try several (at least three) different frequencies and a several pulse shapes (e.g., square, triangle, etc.).

1. Observe the time signal on the oscilloscope. Which frequency components do you expect to see in the frequency spectrum of the signal?
2. Use the FFT on the oscilloscope to observe the frequency spectrum of the signal. Does it agree with your prediction? For the square wave, verify that the frequency spectrum contains odd harmonics with amplitudes proportional to (1/n) for n=1, 3, 5, ...
3. Use the Keithley A/D board to record digital samples of the triangle wave. Do the same for a pulse signal with duty cycle 20%. Be sure to choose the sampling rate larger than twice the highest significant frequency component in the signal! Use the FFT in Matlab to plot the spectrum of the signal. Use subplot to put the time-domain and frequency-domain graphs on the same figure. Are the amplitudes of the harmonics correct relative to the amplitude of the fundamental? Print your plots, and identify the fundamental frequency, the harmonics, and their relative amplitudes.

3. Please submit answers to these questions before you leave lab on November 8 or 13. Continue to work on your design project during each of the lab meetings on November 1, 6, 8, and 13.

Thank you.