Search

Search papers and lessons

Low-Pass Filter

Level 2 · 10 min read

A low-pass filter passes slow changes and weakens fast ones, and a single resistor and capacitor already make one, with its corner set by their product.

On this page

  • Colour = topic mix
  • Calculus
  • Linear algebra
  • Electromagnetism
  • Discrete math
  • Electrical engineering
  • Classical mechanics
  • ReadReady to readNot yet

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 RR in series with a capacitor CC, with the output taken across the capacitor. Choose R=100R = 100 kilohms and C=1C = 1 microfarad, so the time constant is τ=RC=0.1\tau = RC = 0.1 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.

  1. Set the corner. The corner frequency is ωc=1/τ=10\omega_c = 1/\tau = 10 radians per second. Check: this is the frequency where the filter starts to weaken signals noticeably. It is about 1.6 hertz.
  2. 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.
  3. Pass the slow wave. At ω=1\omega = 1 the gain is 1/1+(0.1)2=1/1.01≈0.9951/\sqrt{1 + (0.1)^2} = 1/\sqrt{1.01} \approx 0.995, and the lag is arctan⁡(0.1)≈5.7\arctan(0.1) \approx 5.7 degrees. Check: the slow wave comes out almost unchanged, at amplitude 0.995 and only slightly late.
  4. Weaken the hum. At ω=100\omega = 100 the gain is 1/1+102=1/101≈0.09951/\sqrt{1 + 10^2} = 1/\sqrt{101} \approx 0.0995. Check: the hum is cut to about a tenth of its size, and it lags by arctan⁡(10)≈84\arctan(10) \approx 84 degrees.
  5. Add the outputs. The output is about 0.995sin⁡(t−5.7°)+0.0995sin⁡(100t−84°)0.995 \sin(t - 5.7°) + 0.0995 \sin(100t - 84°). Check: the hum has dropped from amplitude 1 to about 0.1, and the slow wave is almost untouched.
051015202530354000.20.40.60.81ω (rad/s)gain
  • gain for τ = 0.1 s
The gain of the filter stays near 1 below the corner and falls above it. At the corner, ω = 10 rad/s, the gain is 0.71.

The math

Step 1 in symbols: the circuit as a divider

The input is VinV_{in} 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 ω\omega is ZC=1/(jωC)Z_C = 1/(j\omega C), with jj the imaginary unit. Then

H(jω)=VoutVin=ZCR+ZC=11+jωRC=11+jωτ.H(j\omega) = \frac{V_{out}}{V_{in}} = \frac{Z_C}{R + Z_C} = \frac{1}{1 + j\omega RC} = \frac{1}{1 + j\omega\tau}.

This is the transfer function H(s)=1/(1+sτ)H(s) = 1/(1 + s\tau) evaluated at s=jωs = j\omega. The circuit has the same impedance rules as any other sine-wave circuit.

Step 2 in symbols: gain and phase

Write H(jω)H(j\omega) in polar form. The gain and phase are

∣H(jω)∣=11+(ωτ)2,∠H(jω)=−arctan⁡(ωτ).|H(j\omega)| = \frac{1}{\sqrt{1 + (\omega\tau)^2}}, \qquad \angle H(j\omega) = -\arctan(\omega\tau).

The gain is between 0 and 1, and the phase is always a lag. Check: at ωτ=1\omega\tau = 1 the gain is 1/21/\sqrt{2} and the lag is 45 degrees.

Step 3 in symbols: the corner and the slope

The corner frequency is ωc=1/τ\omega_c = 1/\tau, where the gain has fallen to 1/21/\sqrt{2} of its low-frequency value. Well below the corner, ωτ≪1\omega\tau \ll 1 and the gain is close to 1. Well above it, ωτ≫1\omega\tau \gg 1 and the gain is close to 1/(ωτ)1/(\omega\tau). 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 τ=0.1\tau = 0.1 second, the slow wave at ω1=1\omega_1 = 1 has gain 1/1.011/\sqrt{1.01}, and the hum at ω2=100\omega_2 = 100 has gain 1/1011/\sqrt{101}. Because the circuit is linear, a sum of sine waves at different frequencies is treated term by term:

y(t)=∑k=12∣H(jωk)∣sin⁡(ωkt+∠H(jωk)),ω1=1,  ω2=100.y(t) = \sum_{k=1}^{2} \big|H(j\omega_k)\big| \sin\big(\omega_k t + \angle H(j\omega_k)\big), \qquad \omega_1 = 1, \; \omega_2 = 100.

Worked examples

Example
1. Tiny: one resistor, one capacitor (tiny)

Take R=2R = 2 kilohms and C=0.5C = 0.5 microfarads.

  1. The time constant is τ=RC=2000×0.5×10−6=0.001\tau = RC = 2000 \times 0.5 \times 10^{-6} = 0.001 second.
  2. The corner frequency is ωc=1/τ=1000\omega_c = 1/\tau = 1000 radians per second, or about 159 hertz.
  3. At the corner, ωτ=1\omega\tau = 1, so the gain is 1/2≈0.7071/\sqrt{2} \approx 0.707.
  4. At ten times the corner, ω=10,000\omega = 10{,}000 radians per second, so ωτ=10\omega\tau = 10. The gain is 1/101≈0.09951/\sqrt{101} \approx 0.0995.
  5. In decibels, 20log⁡10(0.0995)≈−2020\log_{10}(0.0995) \approx -20 dB.

Interpretation: a tenfold increase above the corner cuts the signal by about 20 decibels, which is roughly a factor of ten in amplitude.

Example
2. Standard: a design that one filter cannot meet

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?

  1. At 5 hertz, ω=2π×5≈31.4\omega = 2\pi \times 5 \approx 31.4 radians per second. A gain of at least 0.95 needs 1+(ωτ)2≤1/0.952≈1.1081 + (\omega\tau)^2 \le 1/0.95^2 \approx 1.108, so ωτ≤0.33\omega\tau \le 0.33.
  2. This gives τ≤0.33/31.4≈0.0105\tau \le 0.33 / 31.4 \approx 0.0105 second.
  3. At 60 hertz, ω=2π×60≈377\omega = 2\pi \times 60 \approx 377 radians per second. A gain of at most 0.05 needs 1+(ωτ)2≥4001 + (\omega\tau)^2 \ge 400, so ωτ≥20\omega\tau \ge 20.
  4. This gives τ≥20/377≈0.053\tau \ge 20 / 377 \approx 0.053 second.
  5. The two conditions need τ≤0.0105\tau \le 0.0105 and τ≥0.053\tau \ge 0.053 at once. They cannot both hold.

Try it: with the largest allowed value τ=0.0105\tau = 0.0105 second, what is the gain at 60 hertz? Answer: ωτ=377×0.0105≈3.96\omega\tau = 377 \times 0.0105 \approx 3.96, so the gain is 1/1+3.962≈1/4.07≈0.251/\sqrt{1 + 3.96^2} \approx 1/4.07 \approx 0.25. 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.

Example
3. Realistic: a tone that folds back after sampling (realistic)

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.

  1. The gain at 30 kilohertz is 1/1+(30/20)2=1/3.25≈0.5551/\sqrt{1 + (30/20)^2} = 1/\sqrt{3.25} \approx 0.555.
  2. In decibels, 20log⁡10(0.555)≈−5.120\log_{10}(0.555) \approx -5.1 dB. The tone is only about 5 decibels down.
  3. The sampler cannot see the difference between this tone and a tone at 44.1−30=14.144.1 - 30 = 14.1 kilohertz. The 30 kilohertz tone folds down to 14.1 kilohertz.
  4. 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: 1/1+22=1/5≈0.4471/\sqrt{1 + 2^2} = 1/\sqrt{5} \approx 0.447, and 20log⁡10(0.447)≈−720\log_{10}(0.447) \approx -7 dB. The tone would fold down to 44.1−40=4.144.1 - 40 = 4.1 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 1/(1+jωτ)1/(1 + j\omega\tau), where τ=RC\tau = RC.
  • The corner is at ω=1/τ\omega = 1/\tau, where the gain falls to 1/21/\sqrt{2}, 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 τ=RC=0.002\tau = RC = 0.002 second. What is the corner frequency in radians per second, and what is the gain at the corner?Show answer

The corner is at ωc=1/τ=500\omega_c = 1/\tau = 500 radians per second. At the corner the gain is 1/2≈0.7071/\sqrt{2} \approx 0.707.

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.

Sources