If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:3:30

Visualizing the Fourier expansion of a square wave

Video transcript

- [Voiceover] So we started with a square wave that had a period of two pi, then we said, hmm, can we represent it as an infinite series of weighted sines and cosines, and then working from that idea, we were actually able to find expressions for the coefficients, for a sub zero and a sub n when n does not equal zero, and the b sub ns. And evaluating it for this particular square wave, we were able to get that a sub n is going to be equal, or a sub zero is going to be 3/2, that a sub n is going to be equal to zero for any n other than zero, and that b sub n is going to be equal to zero if n is even and six over n pi if n is odd. So one way to think about it, you're gonna get your a sub zero, you're not gonna have any of the cosine terms, and you're only going to have the odd sine terms. And if you think about it just visually, if you look at the square wave, it makes sense that you're gonna have the sines and not the cosines because a sine function is gonna look something like this. So a sine function is gonna look something like this, while a cosine function looks something like, let me make it a little bit neater, a cosine function would look something like that. And so a cosine and multiples of cosine of two x, cosine of three x, is gonna be out of phase, while the sine of x, or I should say cosine of ts and the sines of ts, sine two t, sine three t, is gonna be more in phase with the way this function just happened to be. So it made sense that our a sub ns were all zero for n not equaling zero. And so based on what we found for our a sub zero, and our a sub ns, and our b sub ns, we could expand out this actual, we did in the previous video, what is this Fourier series actually look like? So 3/2 plus six over pi sine of t plus six over three pi sine of three t plus six over five pi sine of five t, and so on and so forth. And so a lot of you might be curious what does this actually look like. And so I actually just, you can type these things into Google and it will just graph it for you. And so this right over here is just the first two terms. This is 3/2 plus six over pi sine of t. And notice it's starting to look right because our square wave looks something like, it goes, it looks something like this. So it's gonna go like that and then it's gonna go down to zero and then it's gonna go up, looks something like that. It doesn't have the pis and the two pis marked off between these because it's gonna look something like that. So even just the two terms, it's kind of a decent approximation for even two terms, but then as soon as you get to three terms, if you add the six over three pi sine of three t to the first two terms. So if you look at these first three terms, now it's looking a lot more like a square wave. And then if you add the next term, well, it looks like even more like a square wave, and then if you add to that what we already wrote down here, if you were to add to that six over seven pi times sine of seven t, it looks even more like a square wave. So this is pretty neat. You can visually see that we were actually able to do it. And it all kind of just fell out from the mathematics.