Filters

A filter passes some frequencies and attenuates others. The concept is simple; the details of how steeply they roll off, how flat the passband is, and whether there's ripple or ringing determine which type to use and how to design it. Filters show up in almost every analog signal path — speaker crossovers, radio receivers, anti-aliasing before ADCs, audio equalizers, switching supply output smoothing.

Filter Types by Frequency Response

TypePassesAttenuatesCommon uses
Low-passFrequencies below f_cFrequencies above f_cAnti-aliasing, PWM smoothing, noise reduction, crossover to woofer
High-passFrequencies above f_cFrequencies below f_c (DC blocked)AC coupling, rumble removal, crossover to tweeter, microphone input
Band-passBand around centre frequency f₀Below and above the bandRadio IF stages, audio tone controls, instrument pickups, PLL reference
Band-stop (notch)Everything except the notchSpecific frequency range60/50Hz hum removal, power line interference, DSP anti-resonance
All-passAll frequencies (unchanged amplitude)Nothing — but phase is shiftedPhase compensation, signal delay, phaser audio effects
Frequency responses of four fundamental filter types Four graphs showing the idealized magnitude responses for low-pass, high-pass, band-pass, and band-stop filters. Low-Pass fc High-Pass fc Band-Pass fc Band-Stop fc
Idealized frequency magnitude responses. The horizontal axis is frequency, and the vertical axis is gain.

Filter Order and Rolloff

Filter order determines how steeply the response rolls off past the cutoff frequency:

OrderRolloff (dB/decade)Rolloff (dB/octave)Complexity
1st−20 dB/decade−6 dB/octaveSingle RC stage
2nd−40 dB/decade−12 dB/octaveTwo RC stages or one op-amp Sallen-Key
3rd−60 dB/decade−18 dB/octaveThree stages or one Sallen-Key + one RC
4th−80 dB/decade−24 dB/octaveTwo cascaded 2nd-order sections
nth−20n dB/decade−6n dB/octave

The −3dB point is where output drops to 70.7% of input (by convention, this is the cutoff frequency). A decade means ×10 in frequency; an octave means ×2.

Passive Filters (RC and LC)

First-Order RC

Low-pass:   f_c = 1 / (2πRC)   — R series, C to GND
High-pass:  f_c = 1 / (2πRC)   — C series, R to GND

Simple, cheap, no power needed. Problems: −20dB/decade rolloff is gentle; loading by downstream stages shifts the cutoff; no gain. Fine for rough filtering, EMI suppression, and audio coupling. Not appropriate where you need a sharp boundary between pass and stop bands.

LC Filters

Resonant frequency: f₀ = 1 / (2π√LC)

Advantages over RC:
  - No DC resistance in the path (lossless in ideal case)
  - 2nd order from a single L and C
  - Higher Q possible → sharper resonance

LC low-pass (series L, shunt C):   L in series with signal, C to GND
LC band-pass (series resonant):    L and C in series, resonates at f₀

LC filters shine at RF and power line frequencies. For audio, the inductor's size, cost, and non-ideal behaviour (DCR, nonlinear core) make active RC filters preferable.

Active Filters

An op-amp with RC feedback achieves any filter characteristic without inductors, with no loading issues, and with optional gain in the passband:

Sallen-Key — 2nd Order Low-Pass

Sallen-Key Low-Pass Filter A Sallen-Key active low-pass filter using an op-amp, two resistors in series, a capacitor to ground, and a feedback capacitor. Vin R1 C1 R2 C2 + Vout (unity gain feedback)
The Sallen-Key unity-gain low-pass filter topology. C1 provides positive feedback in the transition band to boost the Q factor and sharpen the corner.
f_c = 1 / (2π × √(R1 × R2 × C1 × C2))

For equal R and C: R1=R2=R, C1=C2=C → f_c = 1/(2πRC)

Multiple Feedback (MFB) — Inverting 2nd Order

Commonly used for higher Q values — the MFB topology is more flexible for Q adjustment than Sallen-Key. One op-amp, three resistors, two capacitors. Inverts the signal.

Filter Characteristics (Approximations)

TypePassbandStopband rolloffPhase responseBest for
ButterworthMaximally flat (no ripple)Moderate (−20n dB/decade)Moderate non-linearGeneral purpose, when passband flatness matters
Chebyshev Type IEquiripple (ripple in passband)Steeper than Butterworth at same orderMore non-linearWhen sharp cutoff is more important than flat passband
Chebyshev Type IIFlat (no passband ripple)Equiripple in stopbandModerateWhen flat passband AND good stopband attenuation needed
Elliptic (Cauer)EquirippleSteepest possible for given order; equirippleHighly non-linearMinimum order for required attenuation; tight space constraints
BesselFlat but wider transitionGentlest rolloffMaximally linear (linear phase)Pulse/waveform fidelity — no ringing or shape distortion

Anti-Aliasing Filter

When sampling an analog signal with an ADC, any frequency above half the sample rate (the Nyquist frequency) gets folded back into the audio spectrum as aliasing — phantom frequencies that don't exist in the original signal. The anti-aliasing filter prevents this:

ADC sample rate: 44.1 kHz (CD quality)
Nyquist frequency: 22.05 kHz

The anti-aliasing low-pass filter must:
  - Pass everything up to 20 kHz (human hearing limit) with minimal loss
  - Sharply attenuate everything above 22.05 kHz

A 5th-order Butterworth or 3rd-order Chebyshev typically achieves this.
Anti-aliasing filter and Nyquist frequency Graph showing a baseband signal spectrum and its aliases folding back around the Nyquist frequency, with an anti-aliasing filter curve applied. Baseband Signal 20 kHz Nyquist (fs/2) 22.05 kHz fs (44.1 kHz) Aliases folding back Anti-aliasing filter response
The anti-aliasing filter must pass the baseband signal (up to 20 kHz) while sharply attenuating any frequencies above the Nyquist frequency (fs/2). Without it, high-frequency noise folds back into the audible spectrum.

Digital Filters

Once a signal is sampled, filtering happens in software. Two families:

TypeFull nameCharacteristicsWhen to use
FIRFinite Impulse ResponseAlways stable, linear phase possible, computationally expensive (many multiplications)When linear phase (waveform shape) matters; audio; linear-phase EQ
IIRInfinite Impulse ResponseComputationally cheap, can be unstable if coefficients wrong, non-linear phaseReal-time processing, microcontrollers, where CPU budget is tight
Simple IIR low-pass (exponential moving average) in code:
  alpha = 0.1   // 0 = no filtering, 1 = instant response
  filtered = alpha × new_sample + (1 - alpha) × filtered

Equivalent time constant: τ ≈ (1/alpha) × sample_period

Filter Design Workflow

  1. Define requirements: passband (f_pass, max attenuation), stopband (f_stop, min attenuation)
  2. Choose approximation (Butterworth/Bessel for flat passband, Chebyshev/Elliptic for steep rolloff)
  3. Calculate required order: n = log((10^(A_s/10) − 1)/(10^(A_p/10) − 1)) / (2 × log(f_s/f_p))
  4. Look up or calculate component values (filter design tables, FilterPro, Analog Devices Filter Wizard)
  5. Simulate in SPICE or LTspice before building
  6. Build, measure on a spectrum analyser, iterate

References