這支影片是我們會製造的一支影片
有一個更新的表現
想像過一個很重要的感覺
例如Math,48的影片
為其他人不太肯定
我希望這支影片
我的第一支影片
就是為了這支影片
有一個更新的影片
但也有些人
已經會否認識
我還以為有些人有甚麼好
在看見看見所有的音量
其實會有些人
這支影片的標準是要做的
是比較高的
D-composing frequencies from sound
但 after that, I also really want to show a glimpse of how this idea extends
well beyond sound and frequency
into 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 pitch 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 versus time graph looks like?
Well, at any point in time, this pressure difference
is going to 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 versus 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 going to 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 going to 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 3 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 0 seconds and 4.5 seconds
The key idea is going to 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 at 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 distance 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 one up graph
is rotating at half a cycle per second
So this is important
There are two different frequencies that 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 the 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 of 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 on mixing 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 the 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
it 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 zero
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 zero
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 versus 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 zero
This big spike around zero in our new frequency plot
just corresponds to the fact
that the whole cosine wave is shifted up
If I chose in a signal that oscillates around zero
dipping into negative values
then as we play around with various winding frequencies
this plot of the winding frequency versus 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 zero
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
to have this chaos and chaos and chaos and chaos
and then whoop
things seem to line up really nicely at two cycles per second
that as you continue on
it's more chaos and more chaos
more chaos
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
is that if you were to take two signals
and then apply this almost Fourier transform
to each of them individually
and then add up the results
what you get is the same
as if you first add it up the signals
and then apply this almost Fourier transform
and the attentive viewers among you might want to pause and ponder
and convince yourself that what I just said is actually true
it's a pretty good test to verify for yourself
that it's clear what exactly is being measured
inside this winding machine
now this property makes things really useful to us
because the transform of a pure frequency
is close to zero everywhere
except for a spike around that frequency
so when you add together two pure frequencies
the transform graph just has these little peaks
above the frequencies that went into it
so this little mathematical machine
does exactly what we wanted
it pulls out the original frequencies
from their jumbled up sums
unmixing the mixed bucket of paint
and before continuing into the full math
that describes this operation
let's just get a quick glimpse of one context
where this thing is useful
sound editing
let's say that you have some recording
and it's got an annoying high pitch
that you would like to filter out
well at first your signal is coming in
as a function of various intensities over time
different voltages given to your speaker
from one millisecond to the next
but we want to think of this in terms of frequencies
so when you take the Fourier transform of that signal
the annoying high pitched is going to show up
just as a spike at some high frequency
filtering that out by just smushing this spike down
what you'd be looking at is the Fourier transform
of a sound that's just like your recording
only without that high frequency
luckily there's a notion of an inverse Fourier transform
that tells you which signal would have produced this
as its Fourier transform
I'll be talking about that inverse
much more fully in the next video
but long story short
applying the Fourier transform
to the Fourier transform
gives you back something close to the original function
hmm kind of this is a little bit of a lie
but it's in the direction of truth
and most of the reason that it's a lie
is that I still have yet to tell you
what the actual Fourier transform is
since it's a little more complex
than this x-coordinate of the center of mass idea
first off bringing back this wound up graph
and looking at its center of mass
the x-coordinate is really only half the story
right I mean this thing is in two dimensions
it's got a y-coordinate as well
and as is typical in math
whenever you're dealing with something
too dimensional
it's elegant to think of it as the complex plane
where this center of mass is going to be a complex number
it has both a real and an imaginary part
and the reason for talking in terms of complex numbers
rather than just saying it has two coordinates
is the complex numbers lend themselves
to really nice descriptions of things
that have to do with winding and rotation
for example
Oilers formula famously tells us
that if you take e to some number times i
you're going to land on the point that you get
if you were to walk that number of units
around a circle with radius one
counterclockwise starting on the right
so imagine you wanted to describe rotating
at a rate of one cycle per second
one thing that you could do
is take the expression
e to the 2 pi times i times t
where t is the amount of time that has passed
since first circle with radius one
2 pi describes the full length of its circumference
and this is a little bit dizzying to look at
so maybe you want to describe a different frequency
something lower and more reasonable
and for that you would just multiply that time t
in the exponent by the frequency
f
for example if f was one tenth
then this vector makes one full turn every ten seconds
since the time t has to increase all the way to ten
before the full exponent looks like two pi i
i have another video giving some intuition
why this is the behavior of e to the x for imaginary inputs
if you're curious
but for right now we're just going to take it as a given
now why am i telling you this you might ask
well it gives us a really nice way to write down the idea
of winding up the graph into a single tight little formula
first off the convention in the context of Fourier transforms
is to think about rotating in the clockwise direction
so let's go ahead and throw a negative sign
up into that exponent
now take some function describing a signal intensity versus time
like this pure cosine wave we had before
and call it g of t
if you multiply this exponential expression
times g of t
it means that the rotating complex number is getting scaled up and down
according to the value of this function
so you can think of this little rotating vector with its changing length
as drawing the wound up graph
so think about it this is awesome
this really small expression is a super elegant way to encapsulate
the whole idea of winding a graph around a circle with a variable frequency
f and remember the thing we want to do with this wound up graph
is to track its center of mass
so think about what formula is going to capture that
well to approximate it at least
you might sample a whole bunch of times from the original signal
see where those points end up on the wound up graph
and then just take an average
that is add them all together as complex numbers
and then divide by the number of points that you've sampled
this will become more accurate if you sample more points which are closer together
and in the limit rather than looking at the sum of a whole bunch of points
divided by the number of points
you take an integral of this function
divided by the size of the time interval that we're looking at
now the idea of integrating a complex valued function might seem weird
and to anyone who's shaky with calculus maybe even intimidating
but the underlying meaning here really doesn't require any calculus knowledge
the whole expression is just the center of mass of the wound up graph
so great step-by-step we have built up this kind of complicated but let's face it
surprisingly small expression for the whole winding machine idea that i talked about
and now there is only one final distinction to point out between this
and the actual honest to goodness Fourier transform
namely just don't divide out by the time interval
the Fourier transform is just the integral part of this
what that means is that instead of looking at the center of mass
you would scale it up by some amount
if the portion of the original graph you were using spanned three seconds
you would multiply the center of mass by three
if it was spanning six seconds you would multiply the center of mass by six
physically this has the effect that when a certain frequency persists for a
long time then the magnitude of the Fourier transform at that frequency
is scaled up more and more for example what we're looking at right here
is how when you have a pure frequency of two beats per second
and you wind it around the graph at two cycles per second
the center of mass stays in the same spot right it's just tracing out the same
shape but the longer that signal persists the larger the value of the
Fourier transform at that frequency
for other frequencies though even if you just increase it by a bit
this is cancelled out by the fact that for longer time intervals
you're giving the wound up graph more of a chance to balance itself around
the circle that is a lot of different moving parts
so let's step back and summarize what we have so far
the Fourier transform of an intensity versus time function like g of t
is a new function which doesn't have time as an input
but instead takes in a frequency what i've been calling the winding frequency
in terms of notation by the way the common convention is to call this new
function g hat with a little circumflex on top of it
now the output of this function is a complex number
some point in the 2d plane that corresponds to the strength of a given
frequency in the original signal the plot that i've been graphing for the
Fourier transform is just the real component of that output
the x coordinate but you could also graph the imaginary component
separately if you wanted a fuller description
and all of this is encapsulated inside that formula that we built up
and out of context you can imagine how seeing this formula would seem sort of
daunting but if you understand how exponentials correspond to rotation
how multiplying that by the function g of t means
drawing a wound up version of the graph and how an integral of a complex
valued function can be interpreted in terms of a center of mass idea
you can see how this whole thing carries with it a very rich intuitive meaning
and by the way one quick small note before we can call this wrapped up
even though in practice with things like sound editing you'll be
integrating over a finite time interval
the theory of Fourier transforms is often phrased where the bounds of this
integral are negative infinity and infinity
concretely what that means is that you consider this expression
for all possible finite time intervals and you just ask what is its limit
has that time interval grows to infinity
and man oh man there is so much more to say so much i don't want to call it
down here this transform extends to corners of math well beyond the idea of
extracting frequencies from signal so the next video i put out is going to go
through a couple of these and that's really where things start getting
interesting so stay subscribed for when that comes out
or an alternate option is to just binge on a couple three blue on brown
videos so that the youtube recommender is more inclined to show you new
things that come out really the choice is yours
and to close things off i have something pretty fun a mathematical puzzler from
this video sponsor Jane street who's looking to recruit more technical talent
so let's say that you have a closed bounded convex set c sitting in 3d space
and then let b be the boundary of that space the surface of your complex
blob now imagine taking every possible pair of points on that surface
and adding them up doing a vector sum let's name this set of all possible sums d
your task is to prove that d is also a convex set
so Jane street is a quantitative trading firm and if you're the kind of
person who enjoys math and solving puzzles like this the team there really
values intellectual curiosity so they might be interested in hiring you
and they're looking both for full-time employees and interns
for my part i can say the couple of people i've interacted with there just
seem to love math and sharing math and when they're hiring they look less at
it background and finance than they do it how you think how you learn and
how you solve problems hence the sponsorship of a three blue one brown video
if you want the answer to that puzzler or to learn more about what they do
or to apply for open positions go to jainstreet.com slash 3b1b