I need help understanding the Fourier components of a square wave


by jeff.berhow
Tags: components, fourier, square, wave
jeff.berhow
jeff.berhow is offline
#1
May20-13, 02:57 AM
P: 16
In my physics book there is an example of making a square wave by "simply" summing up a few cosine waves. The book says these first three waves are the first three Fourier components of a square wave, yet when I sum the three wave functions up, I get something way off; as does my calculator.

For example, if we take the easiest case of x = 0, we get the sum of 1, 1/3, and 1/5 equals 1.53m. However, when I look at the plot for the sums, the amplitude seems to be at about 0.9m. That is nowhere near the sum of the three wave functions at zero. This means that I am missing something fundamentally important here. What is it?

Here's a link to the graphs and the example problem. Thanks for your help.

http://i.imgur.com/DrjU0VE.jpg?1
Phys.Org News Partner Physics news on Phys.org
Physicists design quantum switches which can be activated by single photons
'Dressed' laser aimed at clouds may be key to inducing rain, lightning
Higher-order nonlinear optical processes observed using the SACLA X-ray free-electron laser
DrClaude
DrClaude is offline
#2
May20-13, 03:08 AM
Sci Advisor
PF Gold
DrClaude's Avatar
P: 1,111
They forgot a minus sign: the amplitude of ##D_2## should be ##-\frac{1}{3} D_M##.
jeff.berhow
jeff.berhow is offline
#3
May20-13, 03:20 AM
P: 16
Excellent. Thank you very much, DrClaude.

MisterX
MisterX is offline
#4
May20-13, 01:45 PM
P: 537

I need help understanding the Fourier components of a square wave


Here is how to relate the amplitude of the cosine waves to the amplitude A of the square wave. For this example, [itex]A = \frac{\pi}{4}[/itex].

[itex]D_1 = \frac{4}{\pi}A cos(kx)[/itex]
[itex]D_2 = -\frac{4}{3\pi}A cos(3kx)[/itex]
[itex]D_2 = \frac{4}{5\pi}A cos(5kx)[/itex]

http://www.wolframalpha.com/input/?i...ariable---.*--

If are curious how this can be found:
[itex]a_n = \frac{2}{T} \int_{-T/2}^{T/2} f(x)cos\left(2\pi \frac{n}{T} x\right)dx[/itex]
Where f(x) is the square wave. We observe that the square wave is symmetric across x=0, so we integrate from 0 to T/2, and multiply by 2.
[itex]a_n = \frac{4}{T} \int_{0}^{T/2} f(x)cos\left(2\pi \frac{n}{T} x\right)dx[/itex]
We split this up into two integrals for the positive an negative portions. The square wave is +A in the positive portion and -A in the negative portion.
[itex]a_n = \frac{4}{T}\int_{0}^{T/4} A cos\left(2\pi \frac{n}{T} x\right)dx - \frac{4}{T}\int_{T/4}^{T/2} A cos\left(2\pi \frac{n}{T} x\right)dx [/itex]

[itex]a_n = \left. \frac{4}{T}\frac{T}{2\pi n} A sin\left(2\pi \frac{n}{T} x\right) \right|_{0}^{T/4} - \left. \frac{4}{T}\frac{T}{2\pi n} A sin\left(2\pi \frac{n}{T} x\right)\right|_{T/4}^{T/2} [/itex]
[itex]a_n = \frac{2}{\pi n}A \left[sin \left( \frac{\pi n }{2}\right) - 0 - sin\left(\pi n\right) + sin\left(\frac{\pi n }{2}\right) \right] = \frac{4}{\pi n}Asin \left( \frac{\pi n }{2}\right) - \frac{2}{\pi n}Asin\left(\pi n\right) [/itex]
The second term is always zero, since n is an integer, and thus [itex]sin\left(\pi n\right) = 0[/itex]
[itex]a_n = \frac{4}{\pi n}A sin \left( \frac{\pi n }{2}\right) [/itex]
[itex]a_n = 0, \frac{4A}{\pi}, 0, -\frac{4A}{3\pi}, 0, \frac{4A}{5\pi}, 0 , ... [/itex]

Notice that only the terms with odd n are non-zero. Also, the sign alternates every odd term.

Edit: I have fixed this to show a square wave for any amplitude A. For the square wave in this example, [itex]A = \frac{\pi}{4}[/itex]
DrClaude
DrClaude is offline
#5
May20-13, 03:37 PM
Sci Advisor
PF Gold
DrClaude's Avatar
P: 1,111
Quote Quote by MisterX View Post
Actually all three have the wrong amplitude. They should be multiplied by [itex]\frac{4}{\pi}[/itex], in addition to the second one being negated.
If you look carefully at the figure, you will see that the square wave being approximated has an amplitude of ##\pi/2##, so there is no missing ##4/\pi## factor.
MisterX
MisterX is offline
#6
May20-13, 03:58 PM
P: 537
Quote Quote by DrClaude View Post
If you look carefully at the figure, you will see that the square wave being approximated has an amplitude of ##\pi/2##, so there is no missing ##4/\pi## factor.
Oops, somehow I assumed it was supposed to have an amplitude of [itex]D_M[/itex]. The depicted square wave does seem to have an amplitude of about ##\pi/4##, or in other words a ##\pi/2## peak-to-peak amplitude.


Register to reply

Related Discussions
Square wave exponential fourier series Engineering, Comp Sci, & Technology Homework 3
square wave Fourier series Introductory Physics Homework 15
Fourier Series of Even Square Wave Calculus & Beyond Homework 1
Square wave spectral components General Physics 3
Help with fourier transform for special square wave Calculus & Beyond Homework 1