harmonics and fundamental frequency

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
why odd harmonics are being choosed to form square wave
They are not chosen, they are the result of the Fourier analysis, a mathematical tool used to analyze complex (non-sinusoidal) periodic waveforms. Other waveforms (e.g. trapezoidal, pulse, etc.) will result in different harmonics.

Bob: I hate to say, but do you now see why I wrote:
how is one to understand the significance of an FFT (as pointed out by you) if you do not know what a Fourier transform is all about?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
They are not chosen, they are the result of the Fourier analysis, a mathematical tool used to analyze complex (non-sinusoidal) periodic waveforms. Other waveforms (e.g. trapezoidal, pulse, etc.) will result in different harmonics.

Bob: I hate to say, but do you now see why I wrote:
Harald,

Not sure why this comment is directed at me?

Bob
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
nice link..why odd harmonics are being choosed to form square wave

Think of it like this:

You want a square wave. and all you have is a bunch of sine waves.

First you start with a sine wave at the same frequency as the square wave you want. It's kinda right, but the leading and trailing edges are not very fast, and the top and bottom is certainly not very flat.

square1.png
You want what's in red, but you've only got what's in blue. It's an estimate, but not a good one.

So what can we do. what we want to do is make the rising and falling edges rise and fall faster, and to bring down the peak at the top of the sine wave.

So we look for a frequency that is rising at the same time we want our waveform to rise, falling at the same time we want it to fall, and low in the middle to negate some of the effect of the peak at the top of the original sine wave.

And here is an example:

square2.png
Now we've added the second sine wave at three times the frequency of the original. (that's an odd harmonic, because 3 is an odd number). Added together we get the wobbly orange line.

And that's better than the sine wave. It has a faster rise time and is flatter along the top. But it's still far from perfect.

So we look for the next frequency that tends to counter all the differences between this and a square wave. It turns out to be 5 times the original frequency (that's another odd harmonic).

Wee add that, and the result looks better. Then we add the 7th harmonic, the 9th, the 11th, 13, 15, 17, 19, 21... And eventually the waveform looks pretty square.

Here is a video with better drawing but poorer explanation:

 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
To clarify further, the sine waves must be integer multiples of the original sine wave (otherwise the phase relationship would change and you would get something irregular).

If you look at the even multiples (2, 4, 6, 8, ... ) they will all accentuate the difference between the sine wave and the square wave (by making it more pointy at the top and by reducing the rise and fall times.

If you look at all the odd multiples (3, 5, 7, 9, 11, ...) they will all diminish the difference between the sine wave and the square wave (by increasing rise and fall times and flattening out the top).

Of course you need to add them in the correct ratios as well. If you don't, you'll overcorrect (leading to spikes on the leading and trailing edges) or under correct (leading to "rounded corners" on the square wave).
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,271
Joined
Nov 17, 2011
Messages
14,271
Not sure why this comment is directed at me?
Sorry Bob, an oversight on my side - I may have been a bit hasty in writing that reply. I meant to address Kris with whom I have had a discussion on this.
 
Top