Ah, the Fast Fourier Transform. You see it throughout audio and synthesis. And, of course, it’s the thing that … transforms … things. Faster. It’s a fast way of transforming things. Probably a guy named Fourier was involved. Wait – ever wish you knew more about what an FFT actually is and how it works – or even if you do know, wish you had a better visual reference in your own mind and a way to explain to others?
FFTs and other transfer functions came up last weekend during a live coding master class at Karlsruhe, Germany media center ZKM. Kıvanç Tatar was talking about these in the context of machine learning / AI.
The best explanations are evergreen, so let’s have a look. Normally, the moment you hit discussion of FFTs, equations start cropping up, as in this lecture from Harvard. (Honestly, do still scroll down to see an explanation of low-pass and high-pass filtering that morphs Albert Einstein and Marilyn Monroe together.)
It’s not that the equation is a poor representation. But it’s shorthand; notation. Even a mathematician doesn’t visualize a concept with equations. And the nice thing about this particular kind of math, and waves in sound and many other areas of math and physics, is that they get into a lot of circles. They’re really well-suited to (at least) two-dimensional visualizations.
3Blue1Brown aka Grant Sanderson has some wonderful videos on the topic. Yes, this is generally the kind of rabbit hole my YouTube algorithm goes down.
It’s honestly fun to watch. Also, very cute Pi symbols.
(Bonus, and AI folks may have seen this already, you’ll also find one of the best visual explanations to what a neural network is. Liked and subscribed, check!)
Jason Kottke, one of those pillars of blogging who established the visual reference to permalinks, has a writeup:
A visual introduction to the Fourier Transform [kottke]
Kottke in turn links to the best explanation in words of an FFT I’ve ever seen – with smoothies, and includes this nugget: “The Fourier Transform is useful in engineering, sure, but it’s a metaphor about finding the root causes behind an observed effect.”
The Fourier Transform changes our perspective from consumer to producer, turning What do I have? into How was it made?
In other words: given a smoothie, let’s find the recipe.
An Interactive Guide To The Fourier Transform [betterexplained]
So, I think the easiest way to play around with FFTs is to use the free tool SuperCollider. Again, you don’t need to know the math; you can experiment, get sounds and noises, and basically nothing is wrong. Everything you do is right. A lot of the mistakes you make could turn out to be cool. This is why sound is so much fun to do.
Now that you do have the visual in mind, this will make a whole heck of a lot more sense. Check the FFT documentation in SuperCollider itself, as it’s got useful examples and gets you into a ton of phase vocoding. (Whee!)
Here’s the interactive part of this post – I could use some input, actually. I expect there are a couple of environments that allow the same kind of live coding approaches with FFT in-browser, and I honestly don’t know which they are off-hand. So I’ll try to add those here.
Also, if you do want a more technical explanation including audio references and measurement, here’s a pretty good one (still with some pictures):
Fast Fourier Transformation FFT – Basics [NTI Audio, acoustics/analyzer vendor]
And this I like, too, in that it shows that you don’t need the formula again (nothing against formulae, but it’s then really legible), and some code examples:
The Fast Fourier Transform (FFT) explained – without formulae – with an example in R [abstract new]
Permalinks, ladies and germs! They still work. Thanks, Kottke!