Up: EEE 407/591 - Digital Previous: Lab 3 Main: Main Lab Page

Lab 4 - The Fast Fourier Transform (FFT)


 

Objectives

The fast Fourier transform (FFT) is a fast algorithm for calculating the Discrete Fourier Transform (DFT). The spectral components of the FFT are samples of the continuous DTFT of a finite length N-point signal. In certain cases it may be desireable to augment with zeros a signal (zero-pad) before taking its FFT.With Zero-padding, the DFT to give more closely spaced samples and approximates better the DTFT. While zero-padding does not increase the ability to perfectly resolve closely spaced frequencies, it does give a better idea of the true shape of the DTFT of the signal. Failure to zero-pad a signal may give misleading information about its spectrum. In order to better resolve frequencies in a signal, the length of the window should be increased. In other words, the signal should be examined over a longer period of time.

Another fundamental issue of the FFT is resolution and spectral leakage which is determined by the choice of the truncating window. Resolution is the ability to distinguish between two sinusoids that are closely spaced in frequency. Leakage is when components at one frequency affect the measurement ad into other frequencies and affect the components at those frequencies. If a signal contains 2 closely spaced sinusoids, spectral leakage may cause the spectral peak associated with each sinusoid to merge into one or a strong sinusoid may produce a measurement that will mask the measurement of a weaker sinusoid. This will cause the FFT to indicate that a single sinusoid is present instead of 2.

J-DSP

For this lab, use the J-DSP program. Click the link below

Run J-DSP

 

oProblem 1: Real and Imaginary FFT's

In this problem, we examine different symmetries and determine what type of signal will have an FFT whose real or imaginary part is zero.



  1. Generate the given signals in J-DSP and plot the magnitude and phase of the FFT of size N=8. Use a linear scale. Save the plots of X1[k], X2[k], X3[k] and X4[k] as graph1, graph2, graph3, graph4 respectively. (Note: to save both the magnitude and phase in one graph use two plot blocks with a junction block after the FFT block. )
  2. For which of these FFTs is the real (imaginary) part zero? ( Use FFT and Plot blocks.) Make the plot discrete and look at the real part, then at the imaginary part.

Note: In the Signal Generator Dialog Box you find a button, labeled ``Edit''. Pushing the button allows you to specify the input signal value. Just enter the index and the desired new value in the dialog window and then push update. The new value is shown in the table.

oProblem 2: Zero-padding and windowing

In this problem, we will take a 128-point FFT of a sinusoidal signal. In one case, the 128 points will be the first 128 points of the sinusoidal signal. In the second case, the first 64 points will be the first 64 of the sinusoid and the last 64 samples will be zeros. We will compare the results.

While doing this problem, condider the following 2 questions.

  • Why is the shape of the FFT different when different length windows are used?
  • Theoretically, the DTFT of these 2 signals will have a peak that occurs at different frequencies but have the same magnitude. Will the peaks of the FFT of these two signals also have the same magnitude? To determine this, use the "Values" button in the plot dialog box.

Generate a sine wave of amplitude 1 with (a) tex2html_wrap_inline388and (b) tex2html_wrap_inline390.

Window the sine wave with a

  • (i) rectangular window of length 64 samples
  • (ii) rectangular window of length 128 samples

and plot the FFT of size N=128 for all four cases (use the decibel scale). Why is the shape of the FFT different?

  • (i) for case I. (a) and (i) save the graph as graph5.
  • (ii) for case II. (a) and (ii) save the graph as graph6.
  • (iii) for case III. (b) and (i) save graph as graph7.
  • (iv) for case IV. (b) and (iii) save graph as graph8.

oProblem 3:

Generate a triangular pulse with amplitude 1 and length 16 samples. Plot the FFT of size N=8, 16, 32, 64, 128, 256 (use linear scale). Observe and explain any differences in the graphs. Consider the following questions:

  • What appears to be the maximum value of N at which further increasing N does not provide any new information about the shape of the DTFT?
  • What is the minimum value of N for which the trianglar pulse can be recovered?

Save the graphs as follows. Be sure to use linear magnitude scaling.

  • N=8 - graph9
  • N=16 - graph10
  • N=32 - graph11
  • N=64 - graph12
  • N=128 - graph13
  • N=256 - graph14

oProblem 4: Resolution and Spectral Leakage

The following signal is the sum of two sinusoids which are closely spaced in frequency.
displaymath418
Window x[n] with a

  • (i) rectangular window of length 128 samples
  • (ii) Hamming window of length 128 samples

and plot the FFT of size N=128 for both cases (use decibel scale). In the Signal Generator block, generate signals with 128 pulse width. Save the plot in case (i) as graph15 and the plot in part (ii) as graph16. Why is the shape of the FFT different? Which window would you choose? Is either of these windows able to indicate the presence of 2 sinusoids? Does the spectral leakage due to either one of these windows cause the two spectral peaks to merge into one? (use decibel scale) graph15 graph16

 


Copyright 2008 Andreas Spanias, MIDL, Arizona State University J-DSP and Report Submission Software Developed by ASU-MIDL For questions contact Prof. Spanias spanias@asu.edu.