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

so we started with a square wave that had a period of 2pi then we said hmm can we represent it as an infinite series of weighted signs and co-signs and then working from that 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 ends 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 three halves 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 going to get your a sub you're gonna get your a sub zero you're not going to 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 going to have the signs and not the cosines because a sine function is going to look something like this so a sine function is going to look something like this while a cosine function looks something like looks something like let me make it a little bit neater a cosine function would look something like something like that and so cosine and multiples of cosine of X so cosine of 2x cosine of 3x is going to be out of phase while the sine of X or I should say cosine of T's and the sines of T's sine - 2 T sine 3t is going to be more in phase with the way this function just happened to be so it makes sense that our a sub NS were all 0 for n not equaling 0 and so based on what we found for our a sub 0 and our a sub ends and our B sub ends we could expand out this actual and we did in the previous video what does this Fourier series actually look like so 3 halves plus 6 over pi sine of T plus 6 over 3 pi sine of 3t plus 6 over 5 pi sine of 5t 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 three-halves plus six over pi sine of T I notice is starting to look right because our art square wave looks something like it goes it looks something like this where so it's going to go like that and then it's going to go down to zero and then it's going to go and it's going to go up it looks something like that doesn't have the pies in the two pies marked off clean these because it's going to 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 the six over three pi sine of 3t to the first turn two terms so if you look at these first three terms and that's looking a lot more like a square wave and then if you add the next term well looks like even more like a square wave and then if you add to that to what we already wrote down here if you were to add to that six over seven pi times sine of 70 it looks even more like a square wave so this is pretty neat we get you can visually see that we were actually able to do it and all kind of just fell out from the mathematics