yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Visualizing Fourier expansion of square wave


2m read
·Nov 11, 2024

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?"

Working from that idea, we were actually able to find expressions for the coefficients for a sub 0 and a sub n when n does not equal to 0, and the b sub n's. Evaluating it for this particular square wave, we were able to get that a sub 0 is going to be equal to 3 halves, that a sub n is going to be equal to 0 for any n other than 0, and that b sub n is going to be equal to 0 if n is even and 6 over n pi if n is odd.

One way to think about it, you're going to get your a sub 0; you're not going to have any of the cosine terms, and you're only going to have the odd sine terms. If you think about it just visually, if you look at the square wave, it makes sense that you're going to have the sines and not the cosines.

A sine function is going to 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. 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 the cosines of t and the sines of t, sine 2t, sine 3t, is going to be more in phase with the way this function just happened to be.

So it made sense that our a sub n's were all 0 for n not equaling 0. Based on what we found for our a sub 0 and our a sub n's and our b sub n's, 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. A lot of you might be curious: what does this actually look like?

I actually just—you can type these things into Google, and it will just graph it for you. This right over here is just the first two terms: this is 3 halves plus 6 over pi sine of t. Notice it's starting to look right because our square wave looks something like—it goes, it looks something like this where it’s going to go like that and then it's gonna go down to zero.

It’s gonna go up; it looks something like that. It doesn’t have the pies and the two pies marked off cleanly 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 over 3 pi sine of 3t to the first two terms, these first three terms—now it's looking a lot more like a square wave. Then if you add the next term, it looks even more like a square wave.

If you were to add to that 6 over 7 pi times sine of 7t, 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.

More Articles

View All
What are tax forms? (Part 2) | Taxes and tax forms | Financial literacy | Khan Academy
In this video, we’re going to go into some forms that are very useful when you are filling out your income taxes. If you work for someone as an employee, first and foremost, you’re going to get a W-2 form. I always find the W-2 form interesting. You typic…
Jamie Dimon: The $35 Trillion Dollar Storm Brewing in the US Economy
What you should worry about is the deficit. Today it is 7% of GDP. When Volcker was around and we had very high inflation, it was 3 and a half percent. The debt to GDP is 35% back then, 1982. It’s 100% today. The deficit is the biggest peacetime deficit w…
Subtracting rational expressions: unlike denominators | High School Math | Khan Academy
So right over here we have one rational expression being subtracted from another rational expression. I encourage you to pause the video and see what this would result in, so actually do the subtraction. Alright, now let’s do this together. If we’re subt…
Shower Thoughts: True Facts That Sound Completely Made up
Have you ever paused to think about how one of the most famous sentences of all time doesn’t make grammatical sense? Well, because we all apparently heard it wrong and continue to say it wrong, according to the man himself, Neil Armstrong, what he did say…
How Many Moons Could Earth Handle? #kurzgesagt #shorts
How many moons could Earth handle? The main factor is space. Any moon needs a clean orbit and we have to take two things into account. One, it can’t be too far; otherwise, it won’t follow a stable orbit around us. Two, it can’t be too close either, or the…
Trig functions differentiation | Derivative rules | AP Calculus AB | Khan Academy
So let’s say that we have ( y ) is equal to the secant of (\frac{3\pi}{2} - x), and what we want to do is we want to figure out what (\frac{dy}{dx}) is, the derivative of ( y ) with respect to ( x ) at ( x = \frac{\pi}{4} ). Like always, pause this video…