Subtitles section Play video Print subtitles This right here is what we're going to build to, this video: A certain animated approach to thinking about a super-important idea from math: The Fourier transform. For anyone unfamiliar with what that is, my #1 goal here is just for the video to be an introduction to that topic. But even for those of you who are already familiar with it, I still think that there's something fun and enriching about seeing what all of its components actually look like. The central example, to start, is gonna be the classic one: Decomposing frequencies from sound. But after that, I also really wanna show a glimpse of how this idea extends well beyond sound and frequency, and to many seemingly disparate areas of math, and even physics. Really, it is crazy just how ubiquitous this idea is. Let's dive in. This sound right here is a pure A. 440 beats per second. Meaning, if you were to measure the air pressure right next to your headphones, or your speaker, as a function of time, it would oscillate up and down around its usual equilibrium, in this wave. making 440 oscillations each second. A lower-pitched note, like a D, has the same structure, just fewer beats per second. And when both of them are played at once, what do you think the resulting pressure vs. time graph looks like? Well, at any point in time, this pressure difference is gonna be the sum of what it would be for each of those notes individually. Which, let's face it, is kind of a complicated thing to think about. At some points, the peaks match up with each other, resulting in a really high pressure. At other points, they tend to cancel out. And all in all, what you get is a wave-ish pressure vs. time graph, that is not a pure sine wave; it's something more complicated. And as you add in other notes, the wave gets more and more complicated. But right now, all it is is a combination of four pure frequencies. So it seems...needlessly complicated, given the low amount of information put into it. A microphone recording any sound just picks up on the air pressure at many different points in time. It only "sees" the final sum. So our central question is gonna be how you can take a signal like this, and decompose it into the pure frequencies that make it up. Pretty interesting, right? Adding up those signals really mixes them all together. So pulling them back apart...feels akin to unmixing multiple paint colors that have all been stirred up together. The general strategy is gonna be to build for ourselves a mathematical machine that treats signals with a given frequency... ..differently from how it treats other signals. To start, consider simply taking a pure signal say, with a lowly three beats per second, so that we can plot it easily. And let's limit ourselves to looking at a finite portion of this graph. In this case, the portion between zero seconds, and 4.5 seconds. The key idea, is gonna be to take this graph, and sort of wrap it up around a circle. Concretely, here's what I mean by that. Imagine a little rotating vector where each point in time its length is equal to the height of our graph for that time. So, high points of the graph correspond to a greater disance from the origin, and low points end up closer to the origin. And right now, I'm drawing it in such a way that moving forward two seconds in time corresponds to a single rotation around the circle. Our little vector drawing this wound up graph is rotating at half a cycle per second. So, this is important. There are two different frequencies at play here: There's the frequency of our signal, which goes up and down, three times per second. And then, separately, there's the frequency with which we're wrapping the graph around the circle. Which, at the moment, is half of a rotation per second. But we can adjust that second frequency however we want. Maybe we want to wrap it around faster... ..or maybe we go and wrap it around slower. And that choice of winding frequency determines what the wound up graph looks like. Some of the diagrams that come out of this can be pretty complicated; although, they are very pretty. But it's important to keep in mind that all that's happening here is that we're wrapping the signal around a circle. The vertical lines that I'm drawing up top, by the way, are just a way to keep track of the distance on the original graph that corresponds to a full rotation around the circle. So, lines spaced out by 1.5 seconds would mean it takes 1.5 seconds to make one full revolution. And at this point, we might have some sort of vague sense that something special will happen when the winding frequency matches the frequency of our signal: three beats per second. All the high points on the graph happen on the right side of the circle And all of the low points happen on the left. But how precisely can we take advantage of that in our attempt to build a frequency-unmixing machine? Well, imagine this graph is having some kind of mass to it, like a metal wire. This little dot is going to represent the center of mass of that wire. As we change the frequency, and the graph winds up differently, that center of mass kind of wobbles around a bit. And for most of the winding frequencies, the peaks and valleys are all spaced out around the circle in such a way that the center of mass stays pretty close to the origin. But! When the winding frequency is the same as the frequency of our signal, in this case, three cycles per second, all of the peaks are on the right, and all of the valleys are on the left.. ..so the center of mass is unusually far to the right. Here, to capture this, let's draw some kind of plot that keeps track of where that center of mass is for each winding frequency. Of course, the center of mass is a two-dimensional thing, and requires two coordinates to fully keep track of, but for the moment, let's only keep track of the x coordinate. So, for a frequency of 0, when everything is bunched up on the right, this x coordinate is relatively high. And then, as you increase that winding frequency, and the graph balances out around the circle, the x coordinate of that center of mass goes closer to 0, and it just kind of wobbles around a bit. But then, at three beats per second, there's a spike as everything lines up to the right. This right here is the central construct, so let's sum up what we have so far: We have that original intensity vs. time graph, and then we have the wound up version of that in some two-dimensional plane, and then, as a third thing, we have a plot for how the winding frequency influences the center of mass of that graph. And by the way, let's look back at those really low frequencies near 0. This big spike around 0 in our new frequency plot just corresponds to the fact that the whole cosine wave is shifted up. If I had chosen a signal oscillates around 0, dipping into negative values, then, as we play around with various winding frequences, this plot of the winding frequencies vs. center of mass would only have a spike at the value of three. But, negative values are a little bit weird and messy to think about especially for a first example, so let's just continue thinking in terms of the shifted-up graph. I just want you to understand that that spike around 0 only corresponds to the shift. Our main focus, as far as frequency decomposition is concerned, is that bump at three. This whole plot is what I'll call the "Almost Fourier Transform" of the original signal. There's a couple small distinctions between this and the actual Fourier transform, which I'll get to in a couple minutes, but already, you might be able to see how this machine lets us pick out the frequency of a signal. Just to play around with it a little bit more, take a different pure signal, let's say with a lower frequency of two beats per second, and do the same thing. Wind it around a circle, imagine different potential winding frequencies, and as you do that keep track of where the center of mass of that graph is, and then plot the x coordinate of that center of mass as you adjust the winding frequency. Just like before, we get a spike when the winding frequency is the same as the signal frequency, which in this case, is when it equals two cycles per second. But the real key point, the thing that makes this machine so delightful, is how it enables us to take a signal consisting of multiple frequencies, and pick out what they are. Imagine taking the two signals we just looked at: The wave with three beats per second, and the wave with two beats per second, and add them up. Like I said earlier, what you get is no longer a nice, pure cosine wave; it's something a little more complicated. But imagine throwing this into our winding-frequency machine... ..it is certainly the case that as you wrap this thing around, it looks a lot more complicated; you have this chaos (1) and chaos (2) and chaos (3) and chaos (4) and then WOOP! Things seem to line up really nicely at two cycles per second, and as you continue on it's more chaos (5) and more chaos (6) more chaos (7) chaos (8), chaos (9), chaos (10), WOOP! Things nicely align again at three cycles per second. And, like I said before, the wound up graph can look kind of busy and complicated, but all it is is the relatively simple idea of wrapping the graph around a circle. It's just a more complicated graph, and a pretty quick winding frequency. Now what's going on here with the two different spikes,