WEBVTT

00:00:00.500 --> 00:00:02.350
The Fourier
Coefficients applet lets

00:00:02.350 --> 00:00:05.300
us explore the approximation
of periodic functions

00:00:05.300 --> 00:00:07.450
by Fourier series.

00:00:07.450 --> 00:00:10.660
This is the opening
screen of the applet.

00:00:10.660 --> 00:00:13.780
On the right, you see a
series of sliders controlling

00:00:13.780 --> 00:00:15.840
coefficients.

00:00:15.840 --> 00:00:19.590
And they're the coefficients
of the sine terms in a Fourier

00:00:19.590 --> 00:00:24.780
series, as you can see by
clicking this formula box.

00:00:24.780 --> 00:00:28.720
So at this point, what we're
studying is an odd function,

00:00:28.720 --> 00:00:33.510
a sine series, and the sliders
let us control the coefficients

00:00:33.510 --> 00:00:35.480
of sine of k*t.

00:00:38.340 --> 00:00:41.720
If I click the cosine
box, I'd see coefficients

00:00:41.720 --> 00:00:45.430
of the cosine functions.

00:00:45.430 --> 00:00:50.550
Let's go back to sine
and start to play

00:00:50.550 --> 00:00:54.590
with the tool a little bit.

00:00:54.590 --> 00:00:57.670
What will happen if I
move the b_2 slider?

00:00:57.670 --> 00:01:00.670
I should get multiples
of the sine of 2t

00:01:00.670 --> 00:01:03.040
showing up on my
graphing window.

00:01:03.040 --> 00:01:06.920
If I push b_2 to the right,
I get positive multiples

00:01:06.920 --> 00:01:09.695
of the sine of 2t.

00:01:09.695 --> 00:01:13.070
The sine of 2t goes
through two full periods

00:01:13.070 --> 00:01:15.270
when t ranges from 0 to 2pi.

00:01:18.750 --> 00:01:22.340
And if b_2 is negative,
I get negative multiples

00:01:22.340 --> 00:01:23.140
of the sine of 2t.

00:01:26.560 --> 00:01:31.730
What happens if I
change b_1 in this tool?

00:01:31.730 --> 00:01:35.960
This will add a multiple of
the sine of t to the function

00:01:35.960 --> 00:01:37.790
that I already have.

00:01:37.790 --> 00:01:39.930
If I push this to
the right, I'm going

00:01:39.930 --> 00:01:42.490
to get positive multiples
of the sine of 2t,

00:01:42.490 --> 00:01:45.350
and you can see the
alteration in the yellow graph

00:01:45.350 --> 00:01:46.870
when I do that.

00:01:46.870 --> 00:01:51.930
When I push b_1 to the left,
I'm adding negative multiples

00:01:51.930 --> 00:01:55.290
of the sine of t.

00:01:55.290 --> 00:01:58.330
You get quite a variety
of interesting functions

00:01:58.330 --> 00:02:01.940
by playing with these
various sliders.

00:02:01.940 --> 00:02:05.390
But it's even more
fun to try to match

00:02:05.390 --> 00:02:11.660
a target periodic function by
means of sine or cosine series.

00:02:11.660 --> 00:02:14.650
And the tool has built
into it a whole family

00:02:14.650 --> 00:02:17.550
of target functions to try for.

00:02:17.550 --> 00:02:20.860
Right now, the
target function is 0.

00:02:20.860 --> 00:02:25.450
But we can select target A
instead, and what we have now

00:02:25.450 --> 00:02:27.720
is a square wave.

00:02:27.720 --> 00:02:30.080
Actually, this isn't
the standard square wave

00:02:30.080 --> 00:02:32.700
that we deal with in
the course, quite.

00:02:32.700 --> 00:02:37.260
It is periodic, of period
2pi, and alternates

00:02:37.260 --> 00:02:40.280
between positive
and negative values,

00:02:40.280 --> 00:02:44.900
but those values are pi
over 4 and minus pi over 4,

00:02:44.900 --> 00:02:48.450
instead of plus 1 and
minus 1, as they are

00:02:48.450 --> 00:02:50.940
for the standard square wave.

00:02:50.940 --> 00:02:53.900
That's chosen so that the
Fourier coefficients come

00:02:53.900 --> 00:02:57.340
out more neatly, as we'll see.

00:02:57.340 --> 00:03:00.260
So let's try to
approximate this function

00:03:00.260 --> 00:03:03.870
by a finite trigonometric sum.

00:03:03.870 --> 00:03:08.210
I'm going to push the
Reset key here to reset all

00:03:08.210 --> 00:03:11.160
the coefficients to zero,
and start trying to match

00:03:11.160 --> 00:03:16.320
the function that I have at hand
with multiples of sine of k*t.

00:03:16.320 --> 00:03:22.170
Let's begin with the sine
function itself, sine of t.

00:03:22.170 --> 00:03:25.040
Well, I don't know what to do.

00:03:25.040 --> 00:03:29.300
Let's just set it so
the maxima coincide.

00:03:29.300 --> 00:03:29.870
Why not?

00:03:29.870 --> 00:03:33.120
Maybe that will be
an appropriate amount

00:03:33.120 --> 00:03:36.970
of the sine of t function
to put into the pot

00:03:36.970 --> 00:03:42.660
when I'm trying to mix
up the square wave.

00:03:42.660 --> 00:03:45.810
Let's go on to b_2 now.

00:03:45.810 --> 00:03:49.670
I'm going to push the
b_2 slider to the right.

00:03:49.670 --> 00:03:54.370
When I do that, you
see a hump forming

00:03:54.370 --> 00:03:57.860
on the left-hand side
of the positive part

00:03:57.860 --> 00:03:59.130
of the square wave.

00:03:59.130 --> 00:04:01.950
If push b_2 to the left,
the same kind of hump

00:04:01.950 --> 00:04:06.880
forms on the right-hand
side of that positive part

00:04:06.880 --> 00:04:08.180
of the square wave.

00:04:08.180 --> 00:04:11.390
Neither one of them seems to
be doing us very much good.

00:04:11.390 --> 00:04:17.540
And in fact, it's creating an
asymmetry in the Fourier series

00:04:17.540 --> 00:04:19.930
that's not present in
our target function.

00:04:19.930 --> 00:04:22.960
It's not respecting
the symmetry that you

00:04:22.960 --> 00:04:27.910
see around pi over 2 in
the square wave itself.

00:04:27.910 --> 00:04:30.920
So I suspect that b_2 is not
going to be useful to us,

00:04:30.920 --> 00:04:33.020
that the sine of 2t
is not going to be

00:04:33.020 --> 00:04:39.050
a constituent in the Fourier
series for square wave.

00:04:39.050 --> 00:04:41.240
In fact, I think that
none of the even sines

00:04:41.240 --> 00:04:42.920
will be of any use to us.

00:04:42.920 --> 00:04:46.550
And I can get rid of them and
look only at the odd terms

00:04:46.550 --> 00:04:50.200
by clicking this Odd Terms box.

00:04:50.200 --> 00:04:54.340
This leaves the sine function
that we had in place.

00:04:54.340 --> 00:04:57.690
It eliminates all the
odd terms in the series.

00:04:57.690 --> 00:05:04.830
It eliminates all the even
coefficients and leaves us only

00:05:04.830 --> 00:05:05.945
with the odd ones.

00:05:05.945 --> 00:05:07.320
But there are more
of them, so we

00:05:07.320 --> 00:05:09.403
should be able to do a
better job of approximating

00:05:09.403 --> 00:05:11.240
the square wave.

00:05:11.240 --> 00:05:12.590
So let's continue.

00:05:12.590 --> 00:05:16.680
Let's try changing b_3 to
get a good approximation.

00:05:16.680 --> 00:05:18.810
Well, I could push
b_3 to the left,

00:05:18.810 --> 00:05:21.980
and I get a sharper
spike in the middle.

00:05:21.980 --> 00:05:23.130
That doesn't look too good.

00:05:23.130 --> 00:05:25.510
It looks better to
push b_3 to the right

00:05:25.510 --> 00:05:27.020
and flatten out the top.

00:05:27.020 --> 00:05:30.780
But when I do that, the
top becomes too low.

00:05:30.780 --> 00:05:35.240
And so maybe I made a
mistake in choosing b_1 so

00:05:35.240 --> 00:05:37.260
that the maxima agreed.

00:05:37.260 --> 00:05:40.040
Maybe I should have made
b_1 a little bit bigger.

00:05:40.040 --> 00:05:41.750
Now you can see the
white curve there--

00:05:41.750 --> 00:05:44.870
that's giving me the multiple
of the sine wave itself,

00:05:44.870 --> 00:05:47.570
the one that I'm
controlling by this slider.

00:05:47.570 --> 00:05:51.030
And I guess I should push it
up so that my flat part comes

00:05:51.030 --> 00:05:53.500
closer to the top
of the square wave.

00:05:53.500 --> 00:05:55.940
Maybe that's a
better approximation.

00:05:55.940 --> 00:05:58.140
Well, I can continue
playing this game,

00:05:58.140 --> 00:06:04.050
trying out various multiples
of higher sine functions,

00:06:04.050 --> 00:06:06.615
and going back to try to
fix up what I had before.

00:06:09.240 --> 00:06:11.610
In fact, what we
should be trying to do

00:06:11.610 --> 00:06:15.670
is create a least squares fit.

00:06:15.670 --> 00:06:18.880
You should try to look at
the root-mean-square distance

00:06:18.880 --> 00:06:21.940
between the Fourier series
and the target function,

00:06:21.940 --> 00:06:24.670
and minimize that distance.

00:06:24.670 --> 00:06:26.820
That distance can be
read out in this tool

00:06:26.820 --> 00:06:30.125
by clicking the Distance
button down here.

00:06:30.125 --> 00:06:32.750
And so the
root-mean-square distance

00:06:32.750 --> 00:06:34.595
between the green curve
and the yellow one

00:06:34.595 --> 00:06:38.770
is 0.24 and so on, in this case.

00:06:38.770 --> 00:06:41.670
Let me come down here
and kill the formula.

00:06:41.670 --> 00:06:44.050
We know the formula
well now, and it

00:06:44.050 --> 00:06:48.860
makes the screen a little less
cluttered if we get rid of it.

00:06:48.860 --> 00:06:56.330
And let me reset the values
of the coefficients to zero,

00:06:56.330 --> 00:07:00.020
and start to try to
approximate this square wave

00:07:00.020 --> 00:07:04.110
again by watching the
root-mean-square distance

00:07:04.110 --> 00:07:07.020
between the Fourier
series that I'm creating

00:07:07.020 --> 00:07:08.610
and the target function.

00:07:08.610 --> 00:07:12.030
So I'll start with b_1 in
this case, If I move it down,

00:07:12.030 --> 00:07:13.470
the distance increases.

00:07:13.470 --> 00:07:18.650
If I move it up, the distance
decreases more and more slowly.

00:07:18.650 --> 00:07:21.810
But now when b_1 becomes
greater than one,

00:07:21.810 --> 00:07:22.880
it starts to increase.

00:07:22.880 --> 00:07:24.610
So let me push it down again.

00:07:24.610 --> 00:07:28.910
I can use these little arrow
keys to step the value of b_1.

00:07:28.910 --> 00:07:30.480
That's very convenient.

00:07:30.480 --> 00:07:34.080
I'm just watching the
root-mean-square distance,

00:07:34.080 --> 00:07:35.190
this number up here.

00:07:35.190 --> 00:07:37.870
I'm trying to make that
as small as possible.

00:07:37.870 --> 00:07:39.770
It's a measure of
the closeness of fit.

00:07:39.770 --> 00:07:41.800
Ah, it just started
to increase again.

00:07:41.800 --> 00:07:43.150
Let me step up.

00:07:43.150 --> 00:07:46.120
And I found the value of one.

00:07:46.120 --> 00:07:47.580
I didn't set it to one.

00:07:47.580 --> 00:07:50.870
I set it to the value that
minimized this number.

00:07:50.870 --> 00:07:54.800
And that's the right
quantity of the sine wave

00:07:54.800 --> 00:07:59.960
to put in, if you want to mix
up the square wave, or rather pi

00:07:59.960 --> 00:08:02.170
over 4 times the square wave.

00:08:02.170 --> 00:08:05.110
Let's look at b_3.

00:08:05.110 --> 00:08:07.970
Again, if I decrease
b3, things get worse.

00:08:07.970 --> 00:08:10.390
The root-mean-square
distance increases.

00:08:10.390 --> 00:08:15.000
But if I increase b_3
above the value of zero,

00:08:15.000 --> 00:08:16.880
that number is getting smaller.

00:08:16.880 --> 00:08:17.920
Now it's growing again.

00:08:17.920 --> 00:08:21.640
I think I'll stop there
and use these arrow keys.

00:08:21.640 --> 00:08:26.200
That's better, that's better,
that's better, that's worse.

00:08:26.200 --> 00:08:27.320
Let me go back.

00:08:27.320 --> 00:08:31.100
And I find the
value 0.33 for b_3.

00:08:31.100 --> 00:08:35.539
That's the optimal
amount of the sine of 3t

00:08:35.539 --> 00:08:38.110
to put in if you want
to mix up the formula

00:08:38.110 --> 00:08:40.960
for this square wave.

00:08:40.960 --> 00:08:43.080
I'll do one more.

00:08:43.080 --> 00:08:47.410
Any guesses for what the
optimal value of b_5 should be?

00:08:47.410 --> 00:08:48.670
It's not going to be negative.

00:08:48.670 --> 00:08:51.290
That will increase the
root-mean-square distance.

00:08:51.290 --> 00:08:55.640
Let's push it up in
the positive direction.

00:08:55.640 --> 00:08:58.200
That's about right.

00:08:58.200 --> 00:09:01.325
That's worse, that's
better, that's

00:09:01.325 --> 00:09:03.762
better, better, better, worse.

00:09:03.762 --> 00:09:04.470
I come down here.

00:09:04.470 --> 00:09:05.095
That's optimal.

00:09:08.380 --> 00:09:10.670
We've discovered by
experimentation with this

00:09:10.670 --> 00:09:15.850
applet that the optimal
value of b_5 is 0.200.

00:09:15.850 --> 00:09:18.500
Each one of these
coefficients seems

00:09:18.500 --> 00:09:23.280
to have optimal value equal to
the reciprocal of the index.

00:09:23.280 --> 00:09:27.590
1/3 in this case, 1 in this
case, 1/5 in this case.

00:09:27.590 --> 00:09:30.640
And I predict that the
optimal value of b_7

00:09:30.640 --> 00:09:37.600
is going to be 1/7,
which is about 0.14.

00:09:37.600 --> 00:09:38.605
There you go.

00:09:38.605 --> 00:09:39.520
it's right in there.

00:09:42.030 --> 00:09:46.350
So this applet lets you
understand the true meaning

00:09:46.350 --> 00:09:48.420
of the Fourier coefficients.

00:09:48.420 --> 00:09:52.310
They're the multiples of the
sine waves or the cosine waves

00:09:52.310 --> 00:09:57.700
which give you the optimal fit,
in terms of a finite Fourier

00:09:57.700 --> 00:10:00.620
series, to the target function.