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.
| Type | Passes | Attenuates | Common uses |
|---|---|---|---|
| Low-pass | Frequencies below f_c | Frequencies above f_c | Anti-aliasing, PWM smoothing, noise reduction, crossover to woofer |
| High-pass | Frequencies above f_c | Frequencies below f_c (DC blocked) | AC coupling, rumble removal, crossover to tweeter, microphone input |
| Band-pass | Band around centre frequency f₀ | Below and above the band | Radio IF stages, audio tone controls, instrument pickups, PLL reference |
| Band-stop (notch) | Everything except the notch | Specific frequency range | 60/50Hz hum removal, power line interference, DSP anti-resonance |
| All-pass | All frequencies (unchanged amplitude) | Nothing — but phase is shifted | Phase compensation, signal delay, phaser audio effects |
Filter order determines how steeply the response rolls off past the cutoff frequency:
| Order | Rolloff (dB/decade) | Rolloff (dB/octave) | Complexity |
|---|---|---|---|
| 1st | −20 dB/decade | −6 dB/octave | Single RC stage |
| 2nd | −40 dB/decade | −12 dB/octave | Two RC stages or one op-amp Sallen-Key |
| 3rd | −60 dB/decade | −18 dB/octave | Three stages or one Sallen-Key + one RC |
| 4th | −80 dB/decade | −24 dB/octave | Two 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.
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.
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.
An op-amp with RC feedback achieves any filter characteristic without inductors, with no loading issues, and with optional gain in the passband:
f_c = 1 / (2π × √(R1 × R2 × C1 × C2)) For equal R and C: R1=R2=R, C1=C2=C → f_c = 1/(2πRC)
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.
| Type | Passband | Stopband rolloff | Phase response | Best for |
|---|---|---|---|---|
| Butterworth | Maximally flat (no ripple) | Moderate (−20n dB/decade) | Moderate non-linear | General purpose, when passband flatness matters |
| Chebyshev Type I | Equiripple (ripple in passband) | Steeper than Butterworth at same order | More non-linear | When sharp cutoff is more important than flat passband |
| Chebyshev Type II | Flat (no passband ripple) | Equiripple in stopband | Moderate | When flat passband AND good stopband attenuation needed |
| Elliptic (Cauer) | Equiripple | Steepest possible for given order; equiripple | Highly non-linear | Minimum order for required attenuation; tight space constraints |
| Bessel | Flat but wider transition | Gentlest rolloff | Maximally linear (linear phase) | Pulse/waveform fidelity — no ringing or shape distortion |
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.
Once a signal is sampled, filtering happens in software. Two families:
| Type | Full name | Characteristics | When to use |
|---|---|---|---|
| FIR | Finite Impulse Response | Always stable, linear phase possible, computationally expensive (many multiplications) | When linear phase (waveform shape) matters; audio; linear-phase EQ |
| IIR | Infinite Impulse Response | Computationally cheap, can be unstable if coefficients wrong, non-linear phase | Real-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