Fast Fourier Transform: FFT




 

Functions with a non zero average value may produce a zero frequency component that obscures more interesting components.  This zero frequency component, that is, the average value of the function, is suppressed by default but can be turned off by clicking the 'DC Off' button.
DC On DC Off
The applet is initialized to work with sinusoidal functions that are periodic on the interval [-2, 2] (sine or cosine of integers times pi times x: the Min/Max can be changed if the function is not periodic in that interval). The proportion of sine and cosine terms in the power spectrum are shown as blue and green dots within the power spectrum.

If the function is a function of time, the Physlet animation clock will cause a new transform to be evaluated at every clock tick.

Description:

Any periodic function can be re-constructed from a series of sine and/or cosine functions with appropriate amplitudes and frequencies. The Fourier transform of a periodic function is a mathematical transformation which finds the frequencies and relative amplitudes of the sine and cosine components of a periodic function.

The power spectrum (shown in the bottom graph) is the rms (root mean square) of the amplitude of each sine or cosine component plotted at the frequency for that component. The FFT method finds negative as well as positive frequencies (notice that the power spectrum is plotted with a frequency of zero in the middle) although only the positive frequencies are needed to describe the periodic function.

Question 1:

Change the function to be f(x,t) = sin(2*pi*x) and click the 'set' button. Hold the right button of the mouse down when it is on the top of the red bar in the FFT graph. The first value in the yellow box is the frequency in multiples of 2pi and the second number is the relative amplitude. What is the amplitude and frequency of the function (record positive values only)?

Question 2:

Change the function to be f(x,t) = sin(2*pi*x)+5*sin(5*pi*x) and click the 'set' button. What are the amplitudes and frequencies (postive values- to the right of f = 0 only) of this function?

Question 3:

Suppose you had the following function: f(x,t) = sin(r*pi*x)+P*sin(q*pi*x)+N*sin(m*pi*x). How many red bars would appear on the postive frequency side of the FFT? Give the height of each bar in terms of r, P, q, N and m. Give the frequency of each bar in terms of r, P, q, N and m. Experiment with real numbers to see if you are right.

Question 4:

For each of the following cases draw a sketch of the function, list the amplitudes and corresponding frequencies (positive values only). Be sure to click the 'set' button after each change. What shape of wave are you making with this series?

Question 5:

What shape does the following series create (sketch the shape)? f(x,t) = sin(pi*x)-sin(2*pi*x)/2+sin(3*pi*x)/3-sin(4*pi*x)/4+sin(5*pi*x)/5+...

Question 6:

A generic traveling wave is given by f(x,t) = sin(k*x-w*t) with a speed given by v=w/k. For each of the following waves, give the speed and describe how each is different from the first one. Don't forget to click 'play' after you click 'set'. 

Question 7: 

Now construct the following (nearly) square wave: f(x,t) = sin(pi*x-1*t)+sin(3*pi*x-3*t)/3+sin(5*pi*x-5*t)/5. What is the speed of each of the three components?

Question 8: 

Dispersion is defined to occur when waves of different frequencies travel at different speeds. The result for white light (a mixture of different frequencies) traveling through glass is that different colors travel at different speeds. If the sides of the glass are not parallel, as in a prism, the colors end up separated when they exit the glass. This is how a prism separates white light into colors. Explain why traveling at different speeds would cause different colors to bend by different amounts (consult your text if you are unsure of your answer).

Question 9:

Describe what happens to the (nearly) square wave when one of the components has a slightly different speed: f(x,t) = sin(pi*x-1*t)+sin(3*pi*x-2.9*t)/3+sin(5*pi*x-5*t)/5.

Question 10:



GNU Software

The FFT routine used in the mathapps.FFT applet  uses the jnt.fft package that was developed by Bruce Miller at NIST. Several routines in this subpackage are Java ports of routines derived from Brian Gough's FFT routines in the Gnu Scientific Library (GSL). GSL is released under the Gnu General Public License; As such, this package must also be released under GPL.

The Physlet code for the mathapps.FFT applet may be downloaded here.