# how to design a low pass filter for square waveform

I have square wave signal of 100KHz with few high frequency ringing from 555 timer.when i tried to use a 100KHz first order rc low pass filter,i got a sawtooth waveform because the 100KHz square will have harmonics of sine of higher frequency which got cut down.

The formula available in internet for low pass is valid for sine wave alone.So I want to know if there is any formula for low pass filter for square input.

To generate a 100KHz square wave of 20Vpp which is best method?

• 555 timer and amplify it using amplifier

or

• directly use a amplifier as oscillator

• You should dimension the RC filter based on the ringing frequency, not on the signal frequency. So, not at 100kHz but rather at 1MHz or higher. – Huisman Jan 21 at 10:06
• How "unsquare" can you tolerate your square wave to be and how much ringing can you tolerate? There is no magic bullet for this; just compromise and pragmatism. – Andy aka Jan 21 at 11:05
• You have at least two very different questions in here. At the very least, you need to describe what low pass filter you're trying to use -- and no, low pass filters are not valid for sine waves only. – Scott Seidman Jan 21 at 13:28
• Even better, you should describe what you're trying to achieve. – Scott Seidman Jan 21 at 13:28
• If ringing on the edges of your 555 square wave generator are objectionable, attack the source of ringing rather than try to fix the square wave later. Ringing could be an artifact of your oscilloscope probing, or could be the inductance of too-long wires, or poor power supply bypass capacitance or.... – glen_geek Jan 21 at 15:38

The level of harmonics decrease towards infinity according to sinc function: If the base frequency of square wave is $$\x\$$, harmonics come to frequencies $$\f=x+2Nx\$$, where $$\N\$$ is integer $$\{1,2,3,...}\$$, and the relative level of harmonics for each $$\f\$$ is $$\|\sin(\pi f/(2x))/(f/x)|\$$ (the equation is just simplified from sinc function that is normalized so that level is 1 at $$\x\$$). So, in practice, the level of harmonics after some frequency get insignificant and can be filtered out, but the frequency limit depends on the application, i.e. it depends on the allowed level of ringing and slew rate (Notice that also slew rate becomes the lower the lower is the frequency limit). For example, if the square wave is clock signal, you might even manage with filter passband that equals to the clock frequency. Then basically you have only the base sine component left, but since you just need a periodic signal, that could be enough. Other than that, there is no simple generic rule for the required filter passband.