Filtering harmonics from a circuit containing square waves?

1. Mar 3, 2012

hobbs125

Fourier analysis of a square wave shows that it is made up of sine waves which are harmonics of the square wave.

What I am wondering is how far do these harmonics extend to? Are they all of the same amplitude? And, can specific harmonics be filtered using a series or parallel RC filter?

2. Mar 3, 2012

Staff: Mentor

For a perfect square wave, which jumps from one level to another in zero picoseconds, the harmonics extend to infinity.

What do you think? Can the terms in the Fourier Series give any clue to this?

3. Mar 3, 2012

yungman

Theoretically the harmonics extend to infinite. But real square wave have finite rise time. Don't quote me on this, but I think the highest component has a frequency with period around 2.2 times the rise time of the square wave. Say if you have a square wave with rise time of 1nS, the highest harmonic frequency has a period of about 2.2nS which is like about 400MHz. The amplitudes of any harmonics higher than 400MHz is going to be much lower. Don 't quote on my exact number, but you should get what I am driving at.

Yes, you can use LC filter to get rid of the higher harmonics. RC is too flat. In fact, it is quite common to get a pure sine wave starting with a good square wave. It is not as easy as people think to generate a pure sine wave from oscillator, so might as well start with a square wave and filter it down. I did very critical design that need very pure sine wave and I started with square from a TTL crystal and then use a D flip flop to do a divide by two to get rid of the even harmonics.

4. Mar 9, 2012

Mike_In_Plano

It's practical to make fairly good sine waves from a square wave using a third or fifth order filter.
In power electronics, inverters and motor drives often require waves that have fairly low harmonic content to the fifth harmonic. Beyond that, motors don't object as much because their leakage inductance usually prevents the additional harmonics from causing much loss.

For the lower harmonics, the pulse width can be modulated, or the signal can be stepped. This is the idea behind the quasi sine wave inverter, which reduces the third harmonic by setting its output to "floating" between + output and - output swings.