$$ F(\omega) = \int f(t) e^{i\omega t} dt $$
The Fourier transform is a technique that can
be used to extract the frequency content of a signal. But why does it
work? Let's see if we can follow a simple line of reasoning and invent
this method ourselves!
Disclaimer: A cursory knowledge of integral calculus and complex
numbers is assumed.
The question we're basically asking is, "how long until the signal looks the same again?". Let's think about what that means. Here's a simple signal, just a pure cosine wave, \( f(t) = \cos(t) \):
Technical note: The aficionado may have noticed the missing factors of \( 2\pi \). I've rescaled time for simplicity!
As we often do in real life, let's think about time as a clock. After some time (namely, 24 hours) the clock looks the same again. Let's connect these two ideas and ask, "how fast does the clock need to tick so that the signal looks the same (again) whenever the clock looks the same (again)?". Below is a representation of this hypothetical clock. We'll control how fast it ticks by multiplying the actual time, \( t \), by some factor we'll call \( \omega \). Think about \( \omega \) as being controlled by some knob we can turn up or down:
The reader with some math knowledge might recognize this "clock" as \( e^{i\omega t} \); the equation describing a particle moving around a unit circle with speed proportional to \( \omega\). An equivalent representatation is \( e^{i \omega t} = \cos(\omega t) + i \sin(\omega t) \) - which should seem somewhat magical if you haven't seen it before!
You might see where this is going. Let's find a way attach our signal to the moving clock arm. At every point in time, our signal has some real-valued amplitude, and the arm of the clock is 1 unit away from the origin at some angle which is determined by \( \omega \), which we will now call the winding frequency.
The animation above shows the product of \(f(t) e^{i\omega t}\) - the terms we are integrating in the Fourier transform. The blue curve is the product represented as a curve in the complex plane, and the red dot traces out the path as parametrized by \( t \). Our original signal had a frequency of 1. Compare the pictures when the winding frequency matches this frequency (\( \omega = 1 \)), vs. when it does not. Notice anything? Is one more or less symmetrical than the other? We're very close to understanding what it is the Fourier transform is actually doing!
To be a little more pointed about it, on average, where is the red dot for \( \omega = 1 \) vs. \( \omega = 2 \)? Equivalently, what is the center of mass of the blue curves, and how would you interpret the distance of the red dot from the origin?
If you answered, "When the winding frequency does NOT equal the natural frequency the center of mass is near the origin, and when the winding frequency equals the natural frequency, the center of mass deviates from the origin by an amount proportional to the amplitude of the signal at that frequency", then you win the prize! What is the prize you ask? It's the satisfaction of figuring something out!
Let's see this in action with a signal involving multiple (and perhaps out of phase) frequencies. This time, we'll have
$$ f(t) = 2\sin(t) + \cos(3t + 0.1) + 0.5\sin(5t + 0.6)$$
so our natural frequencies are 1, 3, and 5. First, let's take a look at this signal.
Now let's see if we can pick out the natural frequencies by looking at the center of mass of the wound curves. In this animation, the red dot represents the center of mass as we vary the winding frequency continuously:
And there you have it! Next time you're doing a Fourier transform to produce, say, a power spectrum, the calculations involved should make a lot more sense! Of course, when processing real world (discrete) signals, thanks to the work of Cooley and Tukey 1 (sorry Gauss!) in inventing the FFT (Fast Fourier Transform), we would never actually go through this process. I find it satisfying to have an intuitive understanding of what I'm doing though, and I hope you do too.
Bonus question: The distance from the origin to the center of mass tells us about the amplitude of a signal at a particular frequency. What does the angle tell us?
More fun pages like this coming soon!
[1] Cooley, James W., and John W. Tukey. "An algorithm for the machine calculation of complex Fourier series." Mathematics of Computation 19.90 (1965): 297-301.
[2] Inspired by the 3Blue1Brown video "But what is the Fourier Transform? A visual introduction." (All of this guy's videos are awesome and super informative!)