Frequency Response of RC filter for Square wave input

Thread Starter

aneesh566

Joined Jul 4, 2012
1
I have a RC low pass filter, I am applying square wave input, I am running a frequency analysis. Can anybody clarify what is the expected output?
 

crutschow

Joined Mar 14, 2008
34,408
A square-wave has harmonics of the fundamental frequency due to the sharp edges of the waveform. The low pass filter will roll off the harmonics above (and starting at) the filter corner frequency [1/(2\(\pi\)RC)] and thus round the edges of the square-wave.
 

WBahn

Joined Mar 31, 2012
30,045
Implied by the this is that the effect depends on the ratio of the filter corner frequency to the square wave's fundamental frequency.

The higher this ratio, the more harmonics will pass the filter and the more like a squarewave the output will look.

The lower the ratio, the fewer harmonics will pass and the more like a sine wave (only the fundamental) the response will look. If the ratio is less than one, even the fundamental will be attentuated and, as the ratio drops further, you will get an increasingly small response, but what does get through will look more and more like a clean sine wave.
 

Ron H

Joined Apr 14, 2005
7,063
Actually, at frequencies far above the -3dB frequency, the output will be a triangle wave, becoming lower in amplitude as the frequency increases. It will never look like a sine wave.
 

WBahn

Joined Mar 31, 2012
30,045
Actually, at frequencies far above the -3dB frequency, the output will be a triangle wave, becoming lower in amplitude as the frequency increases. It will never look like a sine wave.
Dooh! You're right.

It will look more and more like a linear ramp due to only seeing the first part of the charge and discharge curves. It will look most like a sine wave near the cutoff frequency, but the skirt for a first-order filter won't be nearly steep enough to keep a significant amount of the first one or two harmonics from getting through.

That's actually an interesting question? At what frequency, relative to the cutoff frequency, would a square-wave look "most" like a sine wave? It's not a particularly simple question, either, leaving aside the fact that what defines "most" has to be dealt with. But I think it would be an educational question to have students play with because it forces them to think about what the spectrum will look like below the cutoff frequency -- and how to calculate it. It's particularly useful if you have them visually decide where they think the best sine wave approximation is by looking at a scope in the lab.
 

WBahn

Joined Mar 31, 2012
30,045
It behaves "like" an integrator for signals that meet certain conditions.

What does the output look like for a step change in voltage? It is an exponential response with an RC time constant. This is NOT the integral of the input signal. So you need the frequency to be high enough such that you are staying in the early part of the exponential curve (where it looks pretty linear) but low enough that the higher harmonics are getting to play too much. I'm not sure it will ever look very sine-wavy and, if it does, if it will be a signal frequency above or below the cutoff frequency. Once you get an octave or so above the cutoff frequency, the harmonic content should be pretty stable with the overall amplitude dropping at 3db/decade, so the shape should be pretty constant, just getting smaller and smaller quickly.
 
Top