< Return to Video

Visualizing Fourier expansion of square wave

  • 0:01 - 0:01
    - [Voiceover] So we started
  • 0:01 - 0:03
    with a square wave
  • 0:03 - 0:04
    that had a period of two pi,
  • 0:04 - 0:06
    then we said, hmm,
  • 0:06 - 0:07
    can we represent it
  • 0:07 - 0:10
    as an infinite series
  • 0:10 - 0:12
    of weighted sines and cosines,
  • 0:12 - 0:14
    and then working from that idea,
  • 0:14 - 0:15
    we were actually able
  • 0:15 - 0:17
    to find expressions
  • 0:17 - 0:18
    for the coefficients,
  • 0:18 - 0:20
    for a sub zero and a sub n
  • 0:20 - 0:21
    when n does not equal zero,
  • 0:21 - 0:22
    and the b sub ns.
  • 0:22 - 0:24
    And evaluating it for this
  • 0:24 - 0:25
    particular square wave,
  • 0:25 - 0:26
    we were able to get
  • 0:26 - 0:27
    that a sub n is going
  • 0:27 - 0:28
    to be equal,
  • 0:28 - 0:29
    or a sub zero is going
  • 0:29 - 0:31
    to be 3/2,
  • 0:31 - 0:32
    that a sub n is going
  • 0:32 - 0:33
    to be equal to zero
  • 0:33 - 0:34
    for any n
  • 0:34 - 0:36
    other than zero,
  • 0:36 - 0:37
    and that b sub n
  • 0:37 - 0:39
    is going to be equal
  • 0:39 - 0:42
    to zero if n is even
  • 0:42 - 0:43
    and six over n pi
  • 0:43 - 0:44
    if n is odd.
  • 0:45 - 0:46
    So one way to think about it,
  • 0:46 - 0:50
    you're gonna get your a sub zero,
  • 0:50 - 0:51
    you're not gonna have any
  • 0:51 - 0:52
    of the cosine terms,
  • 0:52 - 0:53
    and you're only going to have
  • 0:53 - 0:55
    the odd sine terms.
  • 0:56 - 0:57
    And if you think about it
  • 0:57 - 0:58
    just visually, if you look
  • 0:58 - 0:59
    at the square wave,
  • 0:59 - 1:00
    it makes sense
  • 1:00 - 1:01
    that you're gonna have
  • 1:01 - 1:03
    the sines and not the cosines
  • 1:03 - 1:05
    because a sine function
  • 1:05 - 1:08
    is gonna look something like this.
  • 1:08 - 1:10
    So a sine function is gonna look
  • 1:10 - 1:12
    something like this,
  • 1:12 - 1:13
    while a cosine function
  • 1:13 - 1:15
    looks something like,
  • 1:17 - 1:19
    let me make it a little bit neater,
  • 1:19 - 1:21
    a cosine function would look
  • 1:21 - 1:22
    something like that.
  • 1:25 - 1:26
    And so a cosine
  • 1:26 - 1:28
    and multiples of cosine
  • 1:28 - 1:31
    of two x, cosine of three x,
  • 1:31 - 1:32
    is gonna be out of phase,
  • 1:32 - 1:34
    while the sine of x,
  • 1:34 - 1:35
    or I should say cosine of ts
  • 1:35 - 1:36
    and the sines of ts,
  • 1:36 - 1:38
    sine two t, sine three t,
  • 1:38 - 1:39
    is gonna be more in phase
  • 1:39 - 1:40
    with the way this function
  • 1:40 - 1:42
    just happened to be.
  • 1:42 - 1:44
    So it made sense that our
  • 1:44 - 1:46
    a sub ns were all zero
  • 1:46 - 1:48
    for n not equaling zero.
  • 1:48 - 1:50
    And so based on what we found
  • 1:50 - 1:51
    for our a sub zero,
  • 1:51 - 1:52
    and our a sub ns,
  • 1:52 - 1:54
    and our b sub ns,
  • 1:54 - 1:55
    we could expand out
  • 1:55 - 1:56
    this actual,
  • 1:56 - 1:58
    we did in the previous video,
  • 1:58 - 1:59
    what is this Fourier series
  • 1:59 - 2:00
    actually look like?
  • 2:00 - 2:02
    So 3/2 plus six over pi
  • 2:02 - 2:04
    sine of t plus six over three pi
  • 2:04 - 2:05
    sine of three t plus
  • 2:05 - 2:06
    six over five pi
  • 2:06 - 2:07
    sine of five t,
  • 2:07 - 2:09
    and so on and so forth.
  • 2:09 - 2:09
    And so a lot of you might
  • 2:09 - 2:10
    be curious what does this
  • 2:10 - 2:12
    actually look like.
  • 2:12 - 2:13
    And so I actually just,
  • 2:13 - 2:14
    you can type these things
  • 2:14 - 2:15
    into Google and it will
  • 2:15 - 2:17
    just graph it for you.
  • 2:17 - 2:18
    And so this right over here
  • 2:18 - 2:19
    is just the first two terms.
  • 2:19 - 2:22
    This is 3/2 plus six over pi
  • 2:22 - 2:23
    sine of t.
  • 2:24 - 2:25
    And notice it's starting
  • 2:25 - 2:26
    to look right because our
  • 2:26 - 2:28
    square wave looks something
  • 2:28 - 2:29
    like, it goes,
  • 2:31 - 2:34
    it looks something like this.
  • 2:34 - 2:35
    So it's gonna go like that
  • 2:35 - 2:38
    and then it's gonna go down
  • 2:38 - 2:41
    to zero and then it's gonna go
  • 2:43 - 2:45
    up, looks something like that.
  • 2:45 - 2:45
    It doesn't have the pis
  • 2:45 - 2:46
    and the two pis
  • 2:46 - 2:47
    marked off between these
  • 2:47 - 2:48
    because it's gonna look
  • 2:48 - 2:50
    something like that.
  • 2:50 - 2:51
    So even just the two terms,
  • 2:51 - 2:53
    it's kind of a decent approximation
  • 2:53 - 2:54
    for even two terms,
  • 2:54 - 2:55
    but then as soon as you get
  • 2:55 - 2:56
    to three terms,
  • 2:56 - 2:58
    if you add the six
  • 2:58 - 2:59
    over three pi sine of three t
  • 2:59 - 3:01
    to the first two terms.
  • 3:01 - 3:02
    So if you look at these
  • 3:02 - 3:04
    first three terms,
  • 3:04 - 3:04
    now it's looking a lot
  • 3:04 - 3:06
    more like a square wave.
  • 3:06 - 3:08
    And then if you add the next term,
  • 3:08 - 3:09
    well, it looks like even more
  • 3:09 - 3:11
    like a square wave,
  • 3:11 - 3:12
    and then if you add to that
  • 3:12 - 3:14
    what we already wrote down here,
  • 3:14 - 3:16
    if you were to add to that
  • 3:16 - 3:17
    six over seven pi times
  • 3:17 - 3:18
    sine of seven t,
  • 3:18 - 3:19
    it looks even more
  • 3:19 - 3:20
    like a square wave.
  • 3:20 - 3:22
    So this is pretty neat.
  • 3:22 - 3:23
    You can visually see
  • 3:23 - 3:24
    that we were actually able
  • 3:24 - 3:25
    to do it.
  • 3:25 - 3:26
    And it all kind of just
  • 3:26 - 3:29
    fell out from the mathematics.
Title:
Visualizing Fourier expansion of square wave
Description:

more » « less
Video Language:
English
Duration:
03:30

English subtitles

Revisions