Here are a few animations to help explain Fourier Transforms

The animations on this page attempt to aid you in the exploration of digital signal processing and the discrete fourier transform. This was inspired by a G+ conversation that pointed to this blog posting which provides a nice explanation -- but people wanted an animation to make it even clearer. Mathematically, the processing of a signal using a DFT is equivalent to projecting that signal onto a spinning rod and sampling the position of the signal in 2-dimensional space as the rod spins.

Any "signal" can be described as the sum of a bunch of (sine) waves. You see that signal at the top of the animations. But you also see the signal projected onto a set of rotating rods. If you stare and the white dot on the rod it seems to bounce around fairly randomly but, over time, that moving dot forms a stable pattern.

To see what's going on, set up the parameters of the animation as follows: set the signal to just "1 * sin(5πt + 0)", with the other two components having magnitdude zero. Then set the three spinnors to have frequences 4, 5, and 6. You'll see that the spinnor whose frequency matches the sine wave's frequency is off-center, while the other two are symmetrical.

The reason for the sample trace being off-center is that, as the the signal and spinnor move together, the spinnor points in one direction when the signal is positive, but in the opposite direction when the signal is negative. Just as two negatives multiply to give a positive, so a negative displacement in an opposite direction is equivalent to a positive displacement in the same direction.

The asymmetry is the key to the DFT. If you sample a signal at a specific frequency, and average the samples, a non-zero average value indicates that there is energy at that frequency. The more off center the sample, the more energy is focused at just that one frequency.

If this seems to make sense (or even if it doesn't), try adding more frequencies into the signal to see how the patterns are effected. Another thing you might try, with just a single frequency in the signal, is to sample it slightly above or below that frequency (e.g. 4.9 and 5.1 around a 5.0 tone) to see how long it takes to average out the nearby tone.


Loading animation: if the static image doesn't go away almost immediately then you're probably using an ancient browser such as Internet Explorer, on which it doesn't work.

static screenshot for ancient browsers

Created June 2012 by Dave Whipp
(index) (home)
Comments