PHYS 510 - Computational Physics I

Assignment 7: Fourier Transform

Spring 2010


Date Assigned: April 13, 2010
Date Due: April 27, 2010

  1. Discrete Fourier Transform

    1. Sampling Rate and the Nyquist Frequency:

      Consider the function f(t) = cos 6 π t. Sample the function every second, for 32 seconds, and evaluate the power spectrum of the sampled data. Repeat the exercise, taking data every half-second, for 16 seconds, then every quarter-second, for 8 seconds, and every eighth-second, for 4 seconds. (The number of data points N = 32 is the same throughtout this exercise.) What must the minimum sampling rate be for you to determine the true frequency of the function?

      Solution

      One can clearly see the under-sampling problem by just looking at the actual function f(t)= cos(6 π t) and our sampled data point below.

      In this graph, I have plotted a few sampled data points with sampling intervals: 1 second (red circle), 1/2 second (blue cross), and 1/4 second (green triangle). For a sampling rate of one per second, the the data points are constant at one particular value. The sampling simply can't capture the temporal variation of the function. For a given sampling interval Δ, the highest frequency which one can in principle observe is the Nyquist frequency fc= 1/2Δ. The corresponding highest frequencies we can observe with the given sampling rates are respectively 0.5 Hz, 1 Hz, and 2 Hz. Since the function has a frequency of 3 Hz, in order for us to see this frequency, one need to have the Nyquish frequency higher than 3 Hz. In the following, if we decrease our sampling interval to 1/8 sec, our Nyquist frequency can be pushed up to 4 Hz. As we can see from the following power spectra, the function's actual frequency of 3 Hz was not detected until the last case with Δ=1/8 s. One should note that the peaks at 1 Hz in the second and the third graphs correspond to a subharmonic of the actual frequency.

      A C program used to generate these power spectra is given here.
    2. Frequency Leakage and Frequency Resolution:

      Consider the function f(t) = cos 3t. Sample the data every second for 8 seconds. Evaluate and graph the power spectrum of the sampled data. Then, repeat the exercise by sampling the function every second for 16, 32, and 64 seconds. Compare the spectra obtained in each case. Which spectra has a clearer indication of the true frequency of the function? Note that the Nyquist frequency is the same for all cases.

      Solution

      Again, to see the problem of frequency leakage, one can simply look at a plot of the function f(t)=cos(3t) and the sampled data points with a sampling rate of one per second ( red circle).

      In this case, the sampling rate is one per second and its corresponding Nyquist frequency is 0.5 Hz. The actual frequency of the function is (3/2π) and under-sampling is not a problem. However, the mismatch of the the fundamental frequency and the sampling frequency introduces spurious low frequency components in the sampled data. Note the slow oscillation in the sampled data. The result of this mismatch is that the power of the fundamental frequency leaks into other frequencies. This can be seen from the following power spectra.

      The peaks at the fundamental frequency are broaden by this effect. As the total length of the data increases, the resolution in frequencies increases and the peak at the fundamental frequency gets sharper.