TL;DR
A low-pass filter is a circuit or program that lets slow changes through and weakens fast ones. The simplest version is one resistor and one capacitor, and its behaviour is set by a single number, the time constant, which is the resistance times the capacitance. Filters are used to smooth noisy signals, to clean up power supplies, and to remove frequencies that would otherwise be misread when a signal is sampled.
Builds on: Frequency Response, Electrical Impedance, Kirchhoff's Laws · Leads to: Anti-Aliasing, Nyquist Plot
Where it's used
Before a digital converter. An analogue-to-digital converter samples a signal at fixed times. Any frequency above half the sampling rate, the Nyquist limit, is folded down to a false lower frequency, so the filter must remove it before sampling. Compact discs store audio sampled at 44.1 kHz, so content above 22.05 kHz has to be removed first. This is Anti-Aliasing.
Power supplies. A rectifier turns mains alternating current into pulses. With 50 Hz mains, full-wave rectification produces a 100 Hz ripple on the direct-current output. A capacitor after the rectifier acts as a low-pass filter that smooths this ripple, so the device sees an almost steady Voltage.
Smoothing noisy readings. A temperature sensor or an accelerometer reports small random jumps on top of a slow true value. A low-pass filter, in hardware or in software, keeps the slow value and weakens the jumps. A digital version of the filter is the Exponential Moving Average, where the smoothing factor sets how far back the averaging reaches.
How it works
Build the simplest low-pass filter: a resistor in series with a capacitor , with the output taken across the capacitor. Choose kilohms and microfarad, so the time constant is second.
Now feed in a sensor signal made of two sine waves added together: a slow wave of angular frequency 1 radian per second with amplitude 1, and a fast hum at 100 radians per second with amplitude 1.
- Set the corner. The corner frequency is radians per second. Check: this is the frequency where the filter starts to weaken signals noticeably. It is about 1.6 hertz.
- Split the input. Because the circuit is linear, each sine wave can be treated on its own and the outputs added. Check: the slow wave and the hum do not interact.
- Pass the slow wave. At the gain is , and the lag is degrees. Check: the slow wave comes out almost unchanged, at amplitude 0.995 and only slightly late.
- Weaken the hum. At the gain is . Check: the hum is cut to about a tenth of its size, and it lags by degrees.
- Add the outputs. The output is about . Check: the hum has dropped from amplitude 1 to about 0.1, and the slow wave is almost untouched.
- gain for τ = 0.1 s
The math
Step 1 in symbols: the circuit as a divider
The input is and the output is the voltage across the capacitor. The resistor and capacitor are in series, so the two impedances form a voltage divider. The impedance of the capacitor at angular frequency is , with the imaginary unit. Then
This is the transfer function evaluated at . The circuit has the same impedance rules as any other sine-wave circuit.
Step 2 in symbols: gain and phase
Write in polar form. The gain and phase are
The gain is between 0 and 1, and the phase is always a lag. Check: at the gain is and the lag is 45 degrees.
Step 3 in symbols: the corner and the slope
The corner frequency is , where the gain has fallen to of its low-frequency value. Well below the corner, and the gain is close to 1. Well above it, and the gain is close to . Each tenfold rise in frequency then cuts the gain by a factor of 10, which is a fall of 20 decibels per decade (see Decibel (dB)).
Step 4 in symbols: the walkthrough
For the two waves in the walkthrough, with second, the slow wave at has gain , and the hum at has gain . Because the circuit is linear, a sum of sine waves at different frequencies is treated term by term:
Worked examples
Take kilohms and microfarads.
- The time constant is second.
- The corner frequency is radians per second, or about 159 hertz.
- At the corner, , so the gain is .
- At ten times the corner, radians per second, so . The gain is .
- In decibels, dB.
Interpretation: a tenfold increase above the corner cuts the signal by about 20 decibels, which is roughly a factor of ten in amplitude.
A sensor signal contains a 5 hertz value you want to keep, and 60 hertz hum you want to remove. You want the gain at 5 hertz to be at least 0.95, and the gain at 60 hertz to be at most 0.05. Can a single resistor and capacitor do both?
- At 5 hertz, radians per second. A gain of at least 0.95 needs , so .
- This gives second.
- At 60 hertz, radians per second. A gain of at most 0.05 needs , so .
- This gives second.
- The two conditions need and at once. They cannot both hold.
Try it: with the largest allowed value second, what is the gain at 60 hertz? Answer: , so the gain is . That is far above the target of 0.05. The fix is a filter of higher order, built from several stages, whose behaviour is described by a transfer function of higher degree.
An audio system samples at 44.1 kilohertz. Before sampling, it passes the sound through a first-order low-pass filter with a corner at 20 kilohertz. A 30 kilohertz tone is present in the room.
- The gain at 30 kilohertz is .
- In decibels, dB. The tone is only about 5 decibels down.
- The sampler cannot see the difference between this tone and a tone at kilohertz. The 30 kilohertz tone folds down to 14.1 kilohertz.
- The folded tone is still at about 55 percent of its size, so it is audible in the recording.
Interpretation: a first-order filter reduces a tone just above the corner only slightly. Real audio converters use steeper filters, so that content above the folding limit is removed far more strongly before sampling.
Try it: the same filter, now with a tone at 40 kilohertz. What is the gain in decibels? Answer: , and dB. The tone would fold down to kilohertz.
Common mistakes and tradeoffs
It is tempting to think a low-pass filter removes everything above its corner. In fact the gain at the corner is about 0.71, not zero, and the fall continues gradually at 20 decibels per decade. The corner is a half-power point, not a cutoff wall.
It is tempting to think filtering is free. In fact every filter shifts the phase. At the corner the lag is 45 degrees, and in a feedback loop a large lag can make the loop oscillate. This is why the stability check of a loop has to include its filters.
It is tempting to apply an Anti-Aliasing filter after sampling. In fact aliasing happens at the sampling step itself, so the filter must act on the analogue signal before it is sampled.
Use a first-order low-pass filter when the job is simple smoothing, when a few decibels of attenuation is enough, and when the parts must be cheap and passive. Do not use it when you need a steep cutoff, because it falls slowly, or when phase matters, because it adds delay. The alternatives are higher-order filters that cascade several stages, active filters that use amplifiers, and digital filters such as a moving average or an exponential moving average.
History
Telephone engineers at American Telephone and Telegraph in the 1910s and early 1920s, including George Campbell and Otto Zobel, developed the theory of electric wave filters for long-distance lines. Their work set out how to design filters from networks of resistors, capacitors and inductors so that some frequencies pass and others are blocked.
Later, Claude Shannon's sampling result showed that a signal limited to frequencies below half the sampling rate can be recovered from its samples. That made the filter before a sampler essential, because a frequency above the limit cannot be removed after the samples are taken.
The first-order filter caught on because it needs only one resistor and one capacitor, and it gives a simple rule for the corner: one over the time constant.
Recap
- A low-pass filter passes slow changes and weakens fast ones.
- A resistor and capacitor in series give a transfer function , where .
- The corner is at , where the gain falls to , and the gain falls by 20 decibels per decade above it.
- Each filter adds phase lag, and at the corner the lag is 45 degrees.
- Filters are used to smooth power supplies and sensor readings, and to remove frequencies before sampling.
- Read next: Anti-Aliasing for how the filter protects a sampler, and Nyquist Plot for how filters appear in a loop's stability check.
Check yourself
QuestionWhat does a low-pass filter do to a slow signal and to a fast signal?Show answer
A slow signal, below the corner, passes with a gain close to 1. A fast signal, above the corner, is weakened, with the gain falling about 20 decibels for each tenfold increase in frequency.
QuestionA low-pass filter has second. What is the corner frequency in radians per second, and what is the gain at the corner?Show answer
The corner is at radians per second. At the corner the gain is .
QuestionWhy must an anti-aliasing filter act before the sampler rather than after it?Show answer
Aliasing happens during sampling. A frequency above half the sampling rate is folded to a false lower frequency when the samples are taken. Once the samples exist, the false frequency is indistinguishable from a real one, so no later filter can remove it.
QuestionA filter with corner 1 kilohertz is used in a feedback loop. Why might the loop become unstable even though the filter only weakens high frequencies?Show answer
The filter also adds phase lag, which is 45 degrees at the corner and grows toward 90 degrees well above it. A large lag at the frequency where the loop's gain is near 1 can turn a stabilising feedback into one that reinforces oscillations. The loop must be checked with the filter included.