PHYCS 6730 Lab Exercise: Fourier Transform Basics

In this exercise we will be playing with Fourier transforms of real valued data.

You will need the executables ~p6730/exercises/fft/fourier and ~p6730/examples/a05/spectrum as well as several sample signal files in ~p6730/exercises/fft.

Exercise 1 Interpreting the Fourier transform

The executable fourier generates the Fourier transform of the signal data. Normally we feed it a signal defined on N points where N is an integer power of 2, i.e. 1, 2, 4, 8, etc. If this is not the case, fourier pads the signal f(t) out to the next power of 2, and redefines N. The Fourier transform F(k) in the frequency domain is given at frequencies that are multiples k*df of the unit frequency df = 1/(N*dt), where dt is the time interval. For all of our samples we have taken dt = 1. Since for a real signal f(t) we have the reflection rule F(-k) = F*(k) and we always have periodicity F(-k) = F(N-k), fourier lists only the values F(0), F(1), ..., F(N/2-1), F(N/2). The first and last in this list are always real. The rest are usually complex.

Look at the sample signal one_sine. Get its Fourier transform by running

   fourier < one_sine
Which value of k has a nonzero Fourier component? What are the values of F(-4) and F(-28)? Hint: use reflection and/or periodicity.

In case you were checking, the Fourier transform values printed by fourier have been normalized by dividing out 1/sqrt(N).


Exercise 2. Getting a feeling for Fourier transforms

For each of the files dc_signal, two_sine, and nyquist, try to guess the Fourier transform. Start by plotting the files with gnuplot. Then check your guess by running fourier with that file.

Nothing to be handed in.


Exercise 3. Aliasing

The 64-value sample signals high_sine and alias_sine were created with frequency index k = 15 and 17, respectively. Can you see the difference? One has 15 peaks over the full range and the other has 17. Suppose we sampled these signals at every other time - that is, at times 0, 2, 4, ..., 62. Is there a difference between the sampled signals in that case? This result illustrates the aliasing phenomenon.

You can do the sampling easily using the following command:

  awk '{if(NR%2 == 1)print}' alias_sine
In this case the awk utility is told to print a record if the record number (NR) modulo 2 is 1, i.e. it is an odd number.

Exercise 4. One-sided power spectral density

The power spectrum is essentially the square of the modulus of F(k), that is P(k) = |F(k)|2. The one-sided spectral density covers only the range k in [0,N/2]. The two-sided spectral density covers the range [-N/2+1,N/2]. Because of the reflection property F(-k) = F*(k), it follows that P(-k) = P(k). The code spectrum generates the one-sided density by folding over the two-sided density so that the values for k = 1, 2, ..., N/2 - 1 are doubled. In this way the total power for the one-sided spectral density is the same as the total power for the two-sided spectral density.

Use the code spectrum to generate the spectral density for the signals dc_signal, nyquist, and two_sine.

In your answer file, give the peak frequencies in each file.