WEBVTT
00:00:00.500 --> 00:00:03.840
GILBERT STRANG: OK, I'm going
to explain Fourier series,
00:00:03.840 --> 00:00:06.300
and that I can't
do in 10 minutes.
00:00:06.300 --> 00:00:09.460
It'll take two,
maybe three, sessions
00:00:09.460 --> 00:00:15.690
to see enough examples
to really use the idea.
00:00:15.690 --> 00:00:20.640
Let me start with what
we're looking for.
00:00:20.640 --> 00:00:23.190
We have a function.
00:00:23.190 --> 00:00:29.100
And we want to write it as
a combination of cosines
00:00:29.100 --> 00:00:30.920
and sines.
00:00:30.920 --> 00:00:35.880
So those our basis functions--
the cosines and the sine.
00:00:35.880 --> 00:00:39.600
And a n's and the b n's
are the coefficients
00:00:39.600 --> 00:00:41.480
that we have to look for.
00:00:41.480 --> 00:00:47.790
That tells us how much of
cosine nx is in the big function
00:00:47.790 --> 00:00:49.270
f of x.
00:00:49.270 --> 00:00:55.000
Notice that the cosines start at
n equals 0, because cosine of 0
00:00:55.000 --> 00:00:55.950
is 1.
00:00:55.950 --> 00:01:00.020
So there's an a0 in our sum.
00:01:00.020 --> 00:01:05.090
But there isn't a b0, because
n equals zero of the sine
00:01:05.090 --> 00:01:08.680
would be zero, and we
don't get anything there.
00:01:08.680 --> 00:01:11.820
So we're looking for
the a n's and b n's.
00:01:11.820 --> 00:01:16.000
And, really, I want to
show you, at the same time,
00:01:16.000 --> 00:01:21.580
the complex form
with coefficient cn.
00:01:21.580 --> 00:01:25.830
And now n goes from minus
infinity to infinity.
00:01:25.830 --> 00:01:28.820
That's really the
more beautiful form
00:01:28.820 --> 00:01:36.490
because that one formula
for cn does the job,
00:01:36.490 --> 00:01:41.390
whereas here I will need
a separate formula for a n
00:01:41.390 --> 00:01:43.641
and for bn.
00:01:43.641 --> 00:01:44.140
OK.
00:01:46.740 --> 00:01:52.440
So this is natural when
the function is real,
00:01:52.440 --> 00:01:56.220
but in the end, and for the
discrete Fourier transform,
00:01:56.220 --> 00:01:58.560
and for the fast
Fourier transform,
00:01:58.560 --> 00:02:00.490
the complex case will win.
00:02:00.490 --> 00:02:05.170
And, of course, everybody
sees that e to the inx,
00:02:05.170 --> 00:02:10.250
by Euler's great formula, is
a combination of cosine nx
00:02:10.250 --> 00:02:11.370
and sine nx.
00:02:11.370 --> 00:02:16.470
So, I can use those, or I
can use cosine and sine.
00:02:16.470 --> 00:02:17.860
OK.
00:02:17.860 --> 00:02:21.360
So, how do you
find these numbers?
00:02:21.360 --> 00:02:23.600
The key is orthogonality.
00:02:23.600 --> 00:02:28.030
So that's the first central
idea here in Fourier series,
00:02:28.030 --> 00:02:30.460
is the idea of orthogonality.
00:02:30.460 --> 00:02:31.540
Now what does that mean?
00:02:31.540 --> 00:02:33.390
That means perpendicular.
00:02:33.390 --> 00:02:36.930
And for a vector,
and a second vector,
00:02:36.930 --> 00:02:40.100
we have an idea of what
perpendicular means.
00:02:40.100 --> 00:02:42.670
The 90 degree
angle between them.
00:02:42.670 --> 00:02:47.730
And we check that by the dot
product-- or inner product,
00:02:47.730 --> 00:02:52.250
whichever name you like--
between the two vectors
00:02:52.250 --> 00:02:54.090
should be 0.
00:02:54.090 --> 00:02:54.590
OK.
00:02:54.590 --> 00:03:01.560
But here we have functions--
like cosine functions.
00:03:01.560 --> 00:03:06.780
So here's one cosine, and
here's a different cosine.
00:03:06.780 --> 00:03:13.840
So those are two different basis
functions-- say, cosine of 7x
00:03:13.840 --> 00:03:16.155
and cosine of 12 x.
00:03:18.920 --> 00:03:23.310
The coefficients a7
and a12 would tell us
00:03:23.310 --> 00:03:27.840
how much of cosine 7x
is in the function.
00:03:27.840 --> 00:03:32.180
You see, we're separating the
function into frequencies.
00:03:32.180 --> 00:03:37.800
We're looking into pure
oscillations, pure harmonics.
00:03:37.800 --> 00:03:42.140
And we expect, probably,
that's the lower harmonics
00:03:42.140 --> 00:03:46.930
the smoother ones cos
x, cos 2x, cos 3x,
00:03:46.930 --> 00:03:49.270
have most of the energy.
00:03:49.270 --> 00:03:54.660
And the high harmonics,
cosine 12x, cosine 100x,
00:03:54.660 --> 00:03:57.340
probably those are
quickly alternating,
00:03:57.340 --> 00:04:02.990
those contain noise,
and high frequency.
00:04:02.990 --> 00:04:05.360
Quick changes in the
function will show up
00:04:05.360 --> 00:04:07.210
in the high frequencies.
00:04:07.210 --> 00:04:08.470
OK.
00:04:08.470 --> 00:04:13.480
So what's the answer to
this integral-- cosine
00:04:13.480 --> 00:04:21.589
of 7x times cosine of 12x dx,
over the range minus pi to pi?
00:04:21.589 --> 00:04:25.220
Orthogonality comes
in, the answer is 0.
00:04:25.220 --> 00:04:27.140
That's the crucial fact.
00:04:27.140 --> 00:04:32.460
That's what makes it possible
to separate out a7 and a12
00:04:32.460 --> 00:04:34.040
and get hold of them.
00:04:34.040 --> 00:04:36.480
So let me show you
how to do that.
00:04:36.480 --> 00:04:42.780
So I'm going to use this
fact, which is the function
00:04:42.780 --> 00:04:46.300
version of 90 degree angle.
00:04:46.300 --> 00:04:49.775
So, you see, it's a
little like a dot product.
00:04:53.190 --> 00:04:56.730
Well, let me remember, a dot
product would be something
00:04:56.730 --> 00:05:09.650
like c1 d1 plus c2 d2 equals
0, if I had a vector c1 c2
00:05:09.650 --> 00:05:12.610
and a vector d1 d2.
00:05:12.610 --> 00:05:15.730
That would be the dot
product, and it would be 0
00:05:15.730 --> 00:05:17.600
if the vectors are orthogonal.
00:05:17.600 --> 00:05:21.020
Here, instead of
adding, I'm integrating
00:05:21.020 --> 00:05:23.480
because I have functions.
00:05:23.480 --> 00:05:26.710
So just that's the
meaning of dot product--
00:05:26.710 --> 00:05:29.120
the integral of
one function times
00:05:29.120 --> 00:05:31.090
the other function gives 0.
00:05:31.090 --> 00:05:31.820
OK.
00:05:31.820 --> 00:05:33.320
I'll use that now.
00:05:33.320 --> 00:05:35.450
OK, how will I use this?
00:05:35.450 --> 00:05:40.850
I will look what I want.
00:05:40.850 --> 00:05:43.310
This is my goal.
00:05:43.310 --> 00:05:52.850
I'll multiply both sides of
this equation by cosine kx.
00:05:52.850 --> 00:05:55.050
And then I'll integrate.
00:05:55.050 --> 00:05:59.820
And the beauty is, that when
I multiply by cosine kx,
00:05:59.820 --> 00:06:06.520
and I integrate, everything
goes to zero except what I want.
00:06:06.520 --> 00:06:13.880
By the way, all the sines
times cosine kx integrate to 0.
00:06:13.880 --> 00:06:17.980
All the sines are orthogonal
to all the cosines.
00:06:17.980 --> 00:06:21.120
And all the cosines will
be orthogonal to all
00:06:21.120 --> 00:06:22.260
the other cosines.
00:06:22.260 --> 00:06:27.150
So let me show you what I get.
00:06:27.150 --> 00:06:32.930
So I multiply my f
of x by cosine kx,
00:06:32.930 --> 00:06:36.420
and I integrate
from minus pi to pi.
00:06:36.420 --> 00:06:37.240
OK?
00:06:37.240 --> 00:06:41.610
Now, on the right-hand
side, this is my integral
00:06:41.610 --> 00:06:46.530
from minus pi to pi, of my
big sum of all these terms,
00:06:46.530 --> 00:06:56.300
0 to infinity, a n cos nx,
etcetera-- including the sines
00:06:56.300 --> 00:06:58.150
but I'm not even put
them in because they're
00:06:58.150 --> 00:07:04.152
going to get killed by this
integration-- times cosine kx
00:07:04.152 --> 00:07:05.940
dx.
00:07:05.940 --> 00:07:12.370
All I did was take the f
of x equal that formula,
00:07:12.370 --> 00:07:20.180
multiplied both sides by
cosine kx, and integrated.
00:07:20.180 --> 00:07:23.550
And, now the
orthogonality pays off,
00:07:23.550 --> 00:07:26.930
because this times
this, when I integrate
00:07:26.930 --> 00:07:29.690
gives 0, with one exception.
00:07:29.690 --> 00:07:36.230
When n equals k, then
I do get the integral.
00:07:36.230 --> 00:07:46.550
The only term I get is
ak, cosine kx, twice dx.
00:07:46.550 --> 00:07:50.840
Only k equal n
survives this process.
00:07:50.840 --> 00:07:53.200
And then that integral
of cosine squared
00:07:53.200 --> 00:07:59.730
happens to be pi, so
this is just ak times pi.
00:07:59.730 --> 00:08:02.880
Look, I've discovered
what ak is.
00:08:02.880 --> 00:08:08.590
I've discovered the k
Fourier cosine coefficient.
00:08:08.590 --> 00:08:11.290
I just divide by pi.
00:08:11.290 --> 00:08:16.250
So can I just divide by pi
to get this formula for ak?
00:08:16.250 --> 00:08:18.180
Ak is 1 over pi.
00:08:18.180 --> 00:08:24.120
The integral from minus pi
to pi of my function, times
00:08:24.120 --> 00:08:28.320
cosine kx dx.
00:08:28.320 --> 00:08:30.330
That's the formula.
00:08:30.330 --> 00:08:34.880
That tells me the coefficient.
00:08:34.880 --> 00:08:38.549
And I could only do
that with orthogonality
00:08:38.549 --> 00:08:42.059
to knock out all but one term.
00:08:42.059 --> 00:08:46.170
And now, if I wanted
the sine coefficients,
00:08:46.170 --> 00:08:52.220
bk, it would be the same formula
except that would be a sine.
00:08:52.220 --> 00:08:55.740
And if I wanted the
complex coefficient,
00:08:55.740 --> 00:09:00.980
ck, it turns out it'd be
the same formula expect--
00:09:00.980 --> 00:09:04.390
well maybe it's 2 pi
there, 1 over 2 pi--
00:09:04.390 --> 00:09:08.810
and this becomes an
e to the minus ikx.
00:09:08.810 --> 00:09:14.720
In a complex case, the complex
conjugate e to the minus ikx
00:09:14.720 --> 00:09:15.910
shows up.
00:09:15.910 --> 00:09:19.880
So this is really the dot
product, the inner product,
00:09:19.880 --> 00:09:22.180
of the function with the cosine.
00:09:22.180 --> 00:09:23.050
OK.
00:09:23.050 --> 00:09:25.050
So let me do some examples.
00:09:29.700 --> 00:09:34.930
Maybe I should write up the sine
formula that I just mentioned.
00:09:34.930 --> 00:09:43.250
So bk is the integral 1 over
pi, the integral of my function,
00:09:43.250 --> 00:09:47.360
times sine kx dx.
00:09:47.360 --> 00:09:50.600
And there's one exception.
00:09:50.600 --> 00:09:55.500
A0 has a little bit
different formula,
00:09:55.500 --> 00:09:58.380
the pi changes to 2 pi.
00:09:58.380 --> 00:10:00.030
I'm sorry about that.
00:10:00.030 --> 00:10:04.990
When k is 0 or it's the integral
of 1, from minus pi to pi,
00:10:04.990 --> 00:10:06.140
and I get 2 pi.
00:10:06.140 --> 00:10:15.610
So, a0 is 1 over 2 pi-- the
integral of f of x times
00:10:15.610 --> 00:10:20.980
when k is zero
cosine-- this is 1 dx.
00:10:20.980 --> 00:10:22.970
That has a simple meaning.
00:10:22.970 --> 00:10:30.766
That's the average of f of x.
00:10:34.870 --> 00:10:36.050
OK.
00:10:36.050 --> 00:10:42.360
So the basis function was
just 1 when k was zero.
00:10:42.360 --> 00:10:46.610
When k is 0, the function
of my cosine is just one,
00:10:46.610 --> 00:10:51.320
and I get the integral
of the function
00:10:51.320 --> 00:10:55.250
times 1 divided by 2 pi.
00:10:55.250 --> 00:10:57.980
Could we just do an example?
00:10:57.980 --> 00:11:00.020
So I want to take a function.
00:11:00.020 --> 00:11:02.610
And in this video
why don't I take
00:11:02.610 --> 00:11:07.250
an easy, but very important,
function-- the delta function.
00:11:07.250 --> 00:11:11.010
So I plan to use these
formulas on the delta function.
00:11:11.010 --> 00:11:14.090
Let me draw a little picture
of the delta function.
00:11:14.090 --> 00:11:17.850
I'm only going between
minus pi and pi,
00:11:17.850 --> 00:11:20.820
and the delta function,
as we know, is 0,
00:11:20.820 --> 00:11:26.690
it's infinite, at the
spike, and 0 again.
00:11:26.690 --> 00:11:31.270
The reason I wanted to draw it
is, that's an even function.
00:11:31.270 --> 00:11:36.560
That's a function which is
symmetric between x and minus
00:11:36.560 --> 00:11:37.570
x.
00:11:37.570 --> 00:11:42.520
And in that case,
there will be no sines.
00:11:42.520 --> 00:11:45.680
Sine functions are odd.
00:11:45.680 --> 00:11:52.870
The integral from minus pi to
pi of an odd function gives 0.
00:11:52.870 --> 00:12:00.170
The odd means that when
you cross x equals 0
00:12:00.170 --> 00:12:05.860
you get minus the result
for x greater than 0.
00:12:05.860 --> 00:12:10.110
So my point is, this
is an even function--
00:12:10.110 --> 00:12:17.390
delta of x is the same as delta
of minus x, and only cosines.
00:12:21.070 --> 00:12:23.920
Good.
00:12:23.920 --> 00:12:28.690
The sine coefficients
automatically dropped our 0 so,
00:12:28.690 --> 00:12:30.490
of course, the
integral would show it.
00:12:30.490 --> 00:12:33.880
But we see it even
before we integrate.
00:12:33.880 --> 00:12:37.820
OK I'm ready for
the delta function.
00:12:37.820 --> 00:12:43.010
So I'm going to
write delta of x,
00:12:43.010 --> 00:12:45.040
and we remember what
the delta function
00:12:45.040 --> 00:12:50.930
is-- a combination of cosines.
00:12:54.710 --> 00:12:55.330
OK.
00:12:55.330 --> 00:12:59.100
That's the delta function
between minus pi and pi.
00:12:59.100 --> 00:13:00.210
OK.
00:13:00.210 --> 00:13:02.690
And what's our
formula for the a n?
00:13:02.690 --> 00:13:07.770
Well, you remember we had a
special formula for a0, which
00:13:07.770 --> 00:13:14.930
was 1/2 pi times the
integral, from minus pi to pi,
00:13:14.930 --> 00:13:22.110
of our function, which is delta,
times the basis function, which
00:13:22.110 --> 00:13:26.140
n equals 0, the basis
function is 1 dx.
00:13:26.140 --> 00:13:28.210
OK, we know the answer to that.
00:13:28.210 --> 00:13:31.400
We can integrate
the delta function.
00:13:31.400 --> 00:13:34.910
The one key thing about the
integral of the delta function
00:13:34.910 --> 00:13:40.990
is, it's always 1-- if we cross
x equals 0, which we will.
00:13:40.990 --> 00:13:43.510
So that integral is 1
so I'm getting 1/2 pi.
00:13:46.180 --> 00:13:50.260
What about the other
for a coefficient?
00:13:50.260 --> 00:13:52.960
So that's 1/pi, now.
00:13:52.960 --> 00:14:00.520
The integral from minus pi to
pi of all of my function times
00:14:00.520 --> 00:14:02.387
cosine kxdx.
00:14:05.380 --> 00:14:06.490
You know what I'm doing.
00:14:06.490 --> 00:14:09.520
I'm using my formula to
find the coefficients.
00:14:09.520 --> 00:14:13.180
My formula says take the
function, whatever it is--
00:14:13.180 --> 00:14:16.290
and in this example,
it's the delta function--
00:14:16.290 --> 00:14:19.010
multiply by the
cosine, integrate,
00:14:19.010 --> 00:14:22.200
and divide by the factor pi.
00:14:22.200 --> 00:14:23.000
OK.
00:14:23.000 --> 00:14:25.780
Well, of course, we
can do that integral.
00:14:25.780 --> 00:14:28.610
Because when you integrate
a delta function,
00:14:28.610 --> 00:14:36.410
times some other function, all
the action is at x equals 0.
00:14:36.410 --> 00:14:40.660
At x equals 0,
this function is 1.
00:14:40.660 --> 00:14:44.190
And I don't care what it
is elsewhere, it's just 1.
00:14:44.190 --> 00:14:48.820
So this is the same as
integrating delta of x times 1,
00:14:48.820 --> 00:14:52.670
which gives us-- well, the
interval the delta function 1.
00:14:52.670 --> 00:14:56.520
So that integral is one,
so I'm getting 1/pi.
00:14:59.100 --> 00:15:01.110
Good.
00:15:01.110 --> 00:15:02.020
OK.
00:15:02.020 --> 00:15:05.090
So now, do you want
me to write out
00:15:05.090 --> 00:15:06.720
the series for the
delta function?
00:15:06.720 --> 00:15:09.280
It looks kind of unusual.
00:15:09.280 --> 00:15:13.370
This is telling us
something quite remarkable.
00:15:13.370 --> 00:15:18.740
It's telling us that all these
coefficients are the same.
00:15:18.740 --> 00:15:22.870
All the frequencies,
all the harmonics,
00:15:22.870 --> 00:15:27.840
are in the delta function
in equal amounts.
00:15:27.840 --> 00:15:33.710
Usually, we would see a big
drop off of the coefficients ak,
00:15:33.710 --> 00:15:37.000
but for the delta function,
which is so singular,
00:15:37.000 --> 00:15:39.940
all a big spike at
one point, there's
00:15:39.940 --> 00:15:43.690
no drop off and no decay
in the coefficients,
00:15:43.690 --> 00:15:45.170
they just constant.
00:15:45.170 --> 00:15:45.740
OK.
00:15:45.740 --> 00:15:52.010
So I'm saying that the delta
function is the constant term,
00:15:52.010 --> 00:16:04.200
1/2pi, and then 1/pi times
cosine of x, and cosine of 2x,
00:16:04.200 --> 00:16:05.390
and so on.
00:16:10.760 --> 00:16:12.480
OK.
00:16:12.480 --> 00:16:15.540
All frequencies
there are the same.
00:16:15.540 --> 00:16:21.530
And I'll stop with
that one example here.
00:16:21.530 --> 00:16:24.520
So the key points
were orthogonality,
00:16:24.520 --> 00:16:29.390
the formulas for the the
coefficients, and this example.
00:16:29.390 --> 00:16:31.200
Thank you.