Skip to content
LumenaryAcademy
Circuits 65 min

Frequency response, Bode plots and filters

How a circuit treats every frequency at once, how engineers draw it in decibels on a logarithmic axis, and how to design simple filters that keep the frequencies you want.

Code tested · 7AI-draftedAwaiting review by an electrical engineer

Your guides: Chloe · The Physicist, Margaret · The Bench Engineer, Gideon · The Design Reviewer

MotivationH

One circuit, every frequency

A loudspeaker box usually contains two drivers: a large woofer that can move plenty of air but cannot vibrate quickly, and a small tweeter that vibrates quickly but would be destroyed by the large, slow swings of a bass note. Something must send the low frequencies of the music to one and the high frequencies to the other. A sensor connected to an analog-to-digital converter must not let through frequencies above half the sampling rate, or they will reappear in the data disguised as slow signals. A medical amplifier may need to remove the 50 or 60 Hz hum picked up from nearby mains wiring while keeping the heartbeat. A radio must pass one station and reject its neighbours.

Each of these is a filter, a circuit designed to treat different frequencies differently. To design one you need to see a circuit's behaviour at all frequencies at once. The previous lesson, AC circuits, phasors and impedance, solved a circuit at one frequency. Do it at every frequency and plot the result the way engineers do, in decibels on logarithmic axes, and you have the frequency response: the subject of this lesson.

DefinitionsH

Transfer functions and decibels

Definition— Transfer function, frequency response

Drive a linear circuit at its input with a sinusoid of angular frequency ω\omega, and let VinV_\text{in} and VoutV_\text{out} be the phasors of the input and output. Their ratio

H(jω)=VoutVinH(j\omega) = \frac{V_\text{out}}{V_\text{in}}

is the transfer function evaluated at jωj\omega. As ω\omega varies, ∣H(jω)∣|H(j\omega)| (the magnitude response, or gain) says how much each frequency is amplified or attenuated, and ∠H(jω)\angle H(j\omega) (the phase response) how far it is shifted. Together they are the circuit's frequency response.

Because HH is a ratio of phasors, it is found with impedances alone, often as a voltage divider. A sinusoid at frequency ω\omega goes in, the same sinusoid comes out multiplied by ∣H∣|H| and shifted by ∠H\angle H, and by superposition any mixture of frequencies is filtered frequency by frequency.

Definition— Decibel

The decibel (dB) measures a ratio on a logarithmic scale. A power ratio P2/P1P_2/P_1 is 10log⁡10(P2/P1)10\log_{10}(P_2/P_1) dB. Since power is proportional to the square of voltage (across equal resistances), a voltage ratio is 20log⁡10∣V2/V1∣20\log_{10}|V_2/V_1| dB, and the gain in decibels of a transfer function is 20log⁡10∣H(jω)∣20\log_{10}|H(j\omega)|.

Voltage ratio ∣H∣\lvert H\rvert1022\sqrt211/21/\sqrt21/21/21/101/101/1001/1001/10001/1000
Gain (dB)+20+6.02+3.010−3.01−6.02−20−40−60

Decibels turn multiplication into addition: two stages with gains of −6 dB and −20 dB in cascade give −26 dB (provided neither loads the other, a condition we return to below). (Lumenary Math's Exponential and logarithmic functions reviews the rules of logarithms used here.) A logarithmic frequency axis gives each decade (a factor of 10 in frequency) and each octave (a factor of 2) the same width, so that 20 Hz to 20 kHz, the range of human hearing, spans three equal decades. A Bode plot is the pair of graphs, gain in decibels and phase in degrees, against frequency on a logarithmic axis.

A filter's passband is the range of frequencies it passes with little loss; its stopband is the range it attenuates. The cutoff frequency fcf_c is conventionally where the gain has fallen 3.01 dB below its passband value. There ∣H∣|H| is 1/21/\sqrt2 of its passband value, and the power delivered to a resistive load has halved: so fcf_c is also called the half-power or −3 dB frequency. The roll-off is how steeply the gain falls in the stopband, in dB per decade or per octave.

Worked examplesH

First-order filters

The simplest low-pass filter is a resistor followed by a capacitor to ground, with the output taken across the capacitor (circuit (a) in the figure below). As a voltage divider of impedances,

HLP(jω)=1/(jωC)R+1/(jωC)=11+jωRC=11+jω/ωc,ωc=1RC,fc=12πRC.H_\text{LP}(j\omega) = \frac{1/(j\omega C)}{R + 1/(j\omega C)} = \frac{1}{1 + j\omega RC} = \frac{1}{1 + j\omega/\omega_c}, \qquad \omega_c = \frac{1}{RC},\quad f_c = \frac{1}{2\pi RC}.

At low frequencies the capacitor is nearly an open circuit and the input passes unchanged; at high frequencies it is nearly a short circuit and the output collapses. Swap the two parts (circuit (b)) and the output is taken across the resistor:

HHP(jω)=RR+1/(jωC)=jω/ωc1+jω/ωc,H_\text{HP}(j\omega) = \frac{R}{R + 1/(j\omega C)} = \frac{j\omega/\omega_c}{1 + j\omega/\omega_c},

a high-pass filter with the same cutoff. Both are first-order filters: each has one energy store, and its transfer function has ω\omega to the first power in the denominator.

Theorem— Bode asymptotes of a first-order filter

Let H=1/(1+jx)H = 1/(1 + jx) with x=ω/ωcx = \omega/\omega_c. Then:

  1. For x≪1x \ll 1 the gain is close to 0 dB; for x≫1x \gg 1 it is close to −20log⁡10x-20\log_{10} x dB, a straight line falling 20 dB per decade (6.02 dB per octave) that meets the 0 dB line at x=1x = 1.
  2. The gain differs from these two asymptotes by at most 3.01 dB, at x=1x = 1, and by 0.97 dB an octave either side (x=12x = \tfrac12 or 22).
  3. The phase is −arctan⁡x-\arctan x: 0° at low frequency, −45° at the cutoff, −90° at high frequency. The straight line that falls from 0° at x=0.1x = 0.1 to −90° at x=10x = 10 is never more than 5.7° in error.

Proof

The gain is 20log⁡10∣H∣=−10log⁡10(1+x2)20\log_{10}|H| = -10\log_{10}(1 + x^2). For x≤1x \le 1 the asymptote is 0 dB, so the error is −10log⁡10(1+x2)-10\log_{10}(1 + x^2), largest in size at x=1x = 1, where it is −10log⁡102=−3.01-10\log_{10}2 = -3.01 dB. For x≥1x \ge 1 the asymptote is −20log⁡10x=−10log⁡10x2-20\log_{10}x = -10\log_{10}x^2, and the error is −10log⁡10(1+x2)+10log⁡10x2=−10log⁡10(1+1/x2)-10\log_{10}(1 + x^2) + 10\log_{10}x^2 = -10\log_{10}(1 + 1/x^2), again largest at x=1x = 1. At x=2x = 2 or x=12x = \tfrac12 the error is −10log⁡101.25=−0.97-10\log_{10}1.25 = -0.97 dB. For the phase, arctan⁡x\arctan x is 45° at x=1x = 1, like the straight line; at the breakpoints x=0.1x = 0.1 and x=10x = 10 the line reads 0° and 90° while arctan⁡0.1=5.71°\arctan 0.1 = 5.71° and arctan⁡10=84.29°\arctan 10 = 84.29°, and between them the error, which a short calculation shows has its other extremes at about 5.3°5.3°, stays below 5.71°; outside them it shrinks towards zero.

∎

The program prints both filters' responses with fc=1f_c = 1 kHz, compares the low-pass with its asymptotes, and draws a small Bode magnitude plot.

python
import numpy as np

fc = 1000.0                                   # corner frequency: R C = 1 / (2 pi fc)

def lowpass(f):  return 1 / (1 + 1j * f / fc)
def highpass(f): return (1j * f / fc) / (1 + 1j * f / fc)
def db(h):       return 20 * np.log10(np.abs(h))
def deg(h):      return np.degrees(np.angle(h))
def clean(x):    return round(float(x), 2) + 0.0         # so that -0.0004 prints as 0.00

print("    f (Hz) | low-pass  dB  asymptote  error   phase | high-pass dB   phase")
for f in (10, 100, 200, 500, 1000, 2000, 5000, 10000, 100000):
    lp, hp = lowpass(f), highpass(f)
    asym = 0.0 if f <= fc else -20 * np.log10(f / fc)   # the straight-line approximation
    print(f"{f:10.0f} | {clean(db(lp)):11.2f} {clean(asym):9.2f} {clean(db(lp) - asym):7.2f} {deg(lp):7.1f} |"
          f" {clean(db(hp)):11.2f} {deg(hp):7.1f}")

# ASCII Bode magnitude plot of the low-pass: '*' is the true curve, '.' the asymptotes.
cols_per_decade, decades = 12, 4
f_axis = 10 ** np.linspace(1, 1 + decades, cols_per_decade * decades + 1)   # 10 Hz to 100 kHz
true_db = db(lowpass(f_axis))
asym_db = np.where(f_axis <= fc, 0.0, -20 * np.log10(f_axis / fc))
print()
for level in range(0, -45, -5):
    row = ""
    for t, a in zip(true_db, asym_db):
        on_true, on_asym = abs(t - level) <= 2.5, abs(a - level) <= 2.5
        row += "*" if on_true else ("." if on_asym else " ")
    print(f"{level:4d} dB |{row}")
print("        +" + "-" * len(f_axis))
axis = [" "] * (len(f_axis) + 20)
for k, name in enumerate(["10 Hz", "100 Hz", "1 kHz", "10 kHz", "100 kHz"]):
    pos = 9 + k * cols_per_decade                      # under the first column of each decade
    axis[pos:pos + len(name) + 1] = "^" + name
print("".join(axis).rstrip())
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Read the table against the theorem: −3.01 dB at 1 kHz, −0.97 dB an octave either side of it, and from 10 kHz on the true curve lies on the −20 dB per decade asymptote to within 0.04 dB. The high-pass column is the low-pass reflected about 1 kHz: −40 dB at 10 Hz, −3.01 dB at the corner, and a phase that leads by 90° at low frequencies, falling to 0°.

0 dB−20−40 dB0°−45°−90°10 Hz100 Hz1 kHz10 kHz100 kHzfrequency (logarithmic scale)−3.01 dB at the cutoff−45° at the cutoff−20 dB per decadegainphase
Bode plot of the first-order low-pass filter with a 1 kHz cutoff: gain (top) and phase (bottom) on a logarithmic frequency axis. Solid curves are the exact response; dashed lines are the straight-line asymptotes, which are off by at most 3.01 dB and 5.7°.
Worked examplesH

Second-order filters: band-pass and notch

The series RLC circuit of RLC circuits and resonance gives four filters from one loop, depending on where you take the output. With u=ω/ω0u = \omega/\omega_0 and Q=1RL/CQ = \frac1R\sqrt{L/C}, the shared denominator is 1−u2+ju/Q1 - u^2 + ju/Q, and

Hacross C=11−u2+ju/Q,Hacross R=ju/Q1−u2+ju/Q,Hacross L and C=1−u21−u2+ju/Q.H_\text{across C} = \frac{1}{1 - u^2 + ju/Q}, \qquad H_\text{across R} = \frac{ju/Q}{1 - u^2 + ju/Q}, \qquad H_\text{across L and C} = \frac{1 - u^2}{1 - u^2 + ju/Q}.
  • Across the capacitor the circuit is a second-order low-pass: flat below ω0\omega_0, falling 40 dB per decade above it, twice as steep as a first-order filter. Near ω0\omega_0 the gain peaks at about QQ when Q>1/2Q > 1/\sqrt2, which is the resonance of the previous lesson. With Q=1/2Q = 1/\sqrt2 the response is as flat as possible without a peak, the Butterworth response.
  • Across the resistor it is a band-pass filter (circuit (c) below): the gain is exactly 1 (0 dB) at ω0\omega_0, where the inductor and capacitor cancel, and falls 20 dB per decade on either side. Its −3 dB bandwidth is ω0/Q\omega_0/Q, so Q sets how narrow the band is.
  • Across the inductor and capacitor together it is a notch or band-stop filter (circuit (d) is the same idea with the parts rearranged): at ω0\omega_0 the pair has zero impedance and the output is zero, while frequencies well away from ω0\omega_0 pass almost untouched.

Since the resistor voltage and the L-plus-C voltage add up to the input, Hband-pass+Hnotch=1H_\text{band-pass} + H_\text{notch} = 1 at every frequency: what one keeps, the other removes.

(a) RC low-passinoutRC(b) CR high-passinoutCR(c) RLC band-passinoutLCR(d) RLC notchinoutRLC
Four passive filters. (a) RC low-pass and (b) CR high-pass are first order. (c) A series LC feeding a resistor passes a band around ω0 = 1/√(LC). (d) A series LC to ground removes a band around ω0, a notch.

The program evaluates all three outputs of a series circuit with L=10L = 10 mH, C=22C = 22 nF and R=68 ΩR = 68\ \Omega, then finds the band-pass's −3 dB points by bisection.

python
import numpy as np

L, C, R = 10e-3, 22e-9, 68.0          # a series RLC driven by v_in
f0 = 1 / (2 * np.pi * np.sqrt(L * C))
Q = np.sqrt(L / C) / R

def parts(f):
    """Phasor voltages across R (band-pass), across L+C (notch) and across C (low-pass)."""
    w = 2 * np.pi * f
    ZR, ZL, ZC = R, 1j * w * L, 1 / (1j * w * C)
    total = ZR + ZL + ZC
    return ZR / total, (ZL + ZC) / total, ZC / total

db = lambda h: 20 * np.log10(np.abs(h))
clean = lambda x: round(float(x), 2) + 0.0      # so that -0.001 prints as 0.00
print(f"f0 = {f0:.1f} Hz, Q = {Q:.2f}, so the bandwidth should be f0/Q = {f0 / Q:.1f} Hz\n")
print(" f / f0   band-pass dB  phase   notch dB   low-pass dB")
for r in (0.1, 0.5, 0.9, 0.95, 1.0, 1.05, 1.1, 2.0, 10.0):
    bp, notch, lp = parts(r * f0)
    notch_db = f"{clean(db(notch)):10.2f}" if db(notch) > -100 else "    < -100"
    phase = round(float(np.degrees(np.angle(bp))), 1) + 0.0
    print(f"{r:6.2f} {clean(db(bp)):13.2f} {phase:7.1f} {notch_db} {clean(db(lp)):12.2f}")

def crossing(f_lo, f_hi, target=-3.0103):
    """Bisection on a log-frequency axis for where the band-pass magnitude crosses target dB."""
    rising = db(parts(f_lo)[0]) < target
    for _ in range(60):
        mid = np.sqrt(f_lo * f_hi)
        if (db(parts(mid)[0]) < target) == rising:
            f_lo = mid
        else:
            f_hi = mid
    return np.sqrt(f_lo * f_hi)

f1, f2 = crossing(f0 / 10, f0), crossing(f0, f0 * 10)
print(f"\n-3 dB points: {f1:.1f} Hz and {f2:.1f} Hz; bandwidth {f2 - f1:.1f} Hz")
f = np.logspace(2, 6, 1001)
bp, notch, lp = parts(f)
print("band-pass + notch = 1 at every frequency checked:", np.allclose(bp + notch, 1))
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The band-pass centre is 10 730.2 Hz with Q = 9.91, and the −3 dB points at 10 202.7 Hz and 11 285.0 Hz give a bandwidth of 1082.3 Hz, exactly f0/Qf_0/Q. A decade either side the band-pass is down by 39.84 dB. The notch column mirrors it: deep at f0f_0, −2.94 and −3.15 dB at 5% either side, and essentially 0 dB an octave away. The low-pass column shows the resonant peak of the previous lesson, +19.93 dB at f0f_0 (that is, QQ), and −39.91 dB a decade above: the 40 dB-per-decade roll-off.

Checking with SPICE

The netlist builds the band-pass filter, sweeps 1 kHz to 100 kHz with 5000 points per decade, and uses meas to find the peak gain and the two −3 dB crossings.

spice
* Series RLC band-pass filter: output across R
V1 in 0 DC 0 AC 1
L1 in a 10m
C1 a out 22n
R1 out 0 68
.control
ac dec 5000 1k 100k
meas ac gpeak MAX vm(out)
meas ac flo WHEN vdb(out)=-3.0103 RISE=1
meas ac fhi WHEN vdb(out)=-3.0103 FALL=1
let bw = fhi - flo
let f0 = sqrt(flo*fhi)
print f0 bw
.endc
.end

ngspice reports:

text
gpeak               =  9.999999e-01 at=  1.073001e+04
flo                 =  1.020273e+04
fhi                 =  1.128499e+04
f0 = 1.073022e+04
bw = 1.082260e+03

A peak gain of 1 at 10.73 kHz and a bandwidth of 1082.3 Hz, as NumPy found. (The centre frequency is the geometric mean of the −3 dB points, f1f2\sqrt{f_1 f_2}, not their average.)

ComputationC

Designing a filter to a specification

Real design starts from a specification. Suppose a sensor is sampled 10 000 times a second, and we want a first-order low-pass filter in front of the converter with a cutoff of 1.00 kHz, within 5%, at least 12 dB of attenuation at 5 kHz (half the sampling rate), and a resistor between 1 kΩ and 100 kΩ, so that the filter neither draws too much current from the sensor nor is too easily disturbed by what follows it.

The attenuation requirement is easy to check by hand: at 5 kHz, five times the cutoff, a first-order filter gives 10log⁡10(1+52)=14.1510\log_{10}(1 + 5^2) = 14.15 dB. The hard part is that resistors and capacitors come only in preferred values. The international E-series (standardised in IEC 60063) space values evenly on a logarithmic scale: E6 has 6 values per decade (1.0, 1.5, 2.2, 3.3, 4.7, 6.8) and suits capacitors, E24 has 24 and suits 5% and better resistors, and E96 serves 1% parts. The program searches every combination of an E6 capacitor and an E24 resistor.

python
import numpy as np

# Specification: first-order RC low-pass, cutoff 1.00 kHz within 5%, at least 12 dB of
# attenuation at 5 kHz (half the 10 kHz sampling rate), R between 1 kOhm and 100 kOhm.
E24 = [1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7, 3.0,
       3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1]   # resistors
E6 = [1.0, 1.5, 2.2, 3.3, 4.7, 6.8]                                   # capacitors

def values(series, lo, hi):
    out = [m * 10.0**k for k in range(-12, 7) for m in series]
    return [v for v in out if lo <= v * (1 + 1e-9) and v <= hi * (1 + 1e-9)]

target = 1000.0
designs = []
for C in values(E6, 1e-9, 1e-6):
    for R in values(E24, 1e3, 100e3):
        fc = 1 / (2 * np.pi * R * C)
        designs.append((abs(fc / target - 1), R, C, fc))
designs.sort(key=lambda d: (round(d[0], 9), d[1]))   # smallest error; ties go to the smaller R

print("   R          C          fc (Hz)   error   loss at 5 kHz")
for err, R, C, fc in designs[:6]:
    loss = 10 * np.log10(1 + (5000 / fc) ** 2)
    print(f"{R / 1e3:5.1f} kOhm  {C * 1e9:6.1f} nF  {fc:9.1f}  {100 * err:5.2f} %  {loss:6.2f} dB")

# Tolerances move the cutoff: check the worst corners for two grades of capacitor.
err, R, C, fc = designs[0]
print(f"\nchosen: {R / 1e3:.1f} kOhm with {C * 1e9:.0f} nF -> {fc:.1f} Hz")
for r_tol, c_tol in ((0.01, 0.05), (0.01, 0.02)):
    corners = [1 / (2 * np.pi * R * (1 + dr) * C * (1 + dc))
               for dr in (-r_tol, r_tol) for dc in (-c_tol, c_tol)]
    ok = 950 <= min(corners) and max(corners) <= 1050
    print(f"R {r_tol:.0%}, C {c_tol:.0%}: cutoff from {min(corners):.0f} Hz to {max(corners):.0f} Hz"
          f" -> {'meets' if ok else 'fails'} the 5% specification")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Two designs tie for best, 1.6 kΩ with 100 nF and 16 kΩ with 10 nF, both giving 994.7 Hz (0.53% low) and 14.19 dB at 5 kHz. They differ in impedance level: the first draws ten times more current from the source; the second is ten times more easily loaded by what follows. In front of many converters the larger capacitor is preferred, because it also acts as a small charge reservoir for the converter's sampling capacitor.

The tolerance check is the real lesson. With a 1% resistor and an ordinary 5% capacitor, the cutoff could lie anywhere from 938 Hz to 1058 Hz, which fails a ±5% specification even though the nominal design is only 0.53% off. A 2% capacitor (938 becomes 966, 1058 becomes 1025) passes.

IntuitionH

Loading, and why active filters help

Every transfer function above assumed that nothing was connected to the output. In reality the output drives something: a converter's input, the next stage, a loudspeaker. By Thévenin's theorem, the filter looks to its load like a source with an output impedance (for the RC low-pass, RR in parallel with the capacitor's impedance), and the load forms a voltage divider with it. The program below connects loads to the 1.6 kΩ / 100 nF filter, then cascades two RC sections in three ways.

R, 1.6 kΩC, 100 nFRloadinR1C1×1buffer or wireR2C2inout(a) one section driving a load(b) two sections in cascade
The circuits of the loading experiment. (a) The 1.6 kΩ, 100 nF low-pass section with a load resistor across its output. (b) Two RC sections in cascade, joined either by a plain wire or by a unity-gain buffer (dashed), an amplifier that copies its input voltage while drawing no current from it.
python
import numpy as np

R, C = 1.6e3, 100e-9                      # the low-pass designed above: fc = 994.7 Hz

def par(a, b):                            # two impedances in parallel
    return a * b / (a + b)

def rc_loaded(f, R, C, R_load=np.inf):
    Zc = 1 / (2j * np.pi * f * C)
    Zp = Zc if np.isinf(R_load) else par(Zc, R_load)
    return Zp / (R + Zp)

def two_sections(f, R1, C1, R2, C2, buffered):
    """Two RC low-passes in cascade, with or without an ideal buffer between them."""
    if buffered:
        return rc_loaded(f, R1, C1) * rc_loaded(f, R2, C2)
    Zc1, Zc2 = 1 / (2j * np.pi * f * C1), 1 / (2j * np.pi * f * C2)
    Zp = par(Zc1, R2 + Zc2)               # the second section loads the first
    return Zp / (R1 + Zp) * Zc2 / (R2 + Zc2)

def cutoff(H, lo=1.0, hi=1e6):
    """Where |H| is 3.01 dB below its low-frequency value (bisection on a log axis)."""
    ref = abs(H(0.01))
    for _ in range(100):
        mid = np.sqrt(lo * hi)
        lo, hi = (mid, hi) if abs(H(mid)) > ref / np.sqrt(2) else (lo, mid)
    return lo

print("load on the filter     DC gain    cutoff")
for R_load in (np.inf, 100e3, 10e3, 1.6e3):
    H = lambda f: rc_loaded(f, R, C, R_load)
    name = "none" if np.isinf(R_load) else f"{R_load / 1e3:g} kOhm"
    gain_db = round(20 * np.log10(abs(H(0.01))), 2) + 0.0   # + 0.0 turns -0.0 into 0.0
    print(f"{name:18} {gain_db:8.2f} dB {cutoff(H):8.1f} Hz")

print("\ntwo sections in cascade                 cutoff   at 5 kHz")
cases = [("buffered, both 1.6 kOhm / 100 nF", (R, C, R, C, True)),
         ("unbuffered, both 1.6 kOhm / 100 nF", (R, C, R, C, False)),
         ("unbuffered, second 16 kOhm / 10 nF", (R, C, 10 * R, C / 10, False))]
for name, args in cases:
    H = lambda f: two_sections(f, *args)
    print(f"{name:38} {cutoff(H):6.1f} Hz {20 * np.log10(abs(H(5000))):7.2f} dB")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

A 100 kΩ load barely matters (−0.14 dB, cutoff moved 1.6%). A 10 kΩ load costs 1.29 dB of passband gain and pushes the cutoff from 994.7 Hz to 1153.9 Hz. A load equal to RR halves the gain and doubles the cutoff. Cascading is worse: two identical sections, wired directly, have a cutoff of 372.3 Hz, not the 640.2 Hz that two independent sections would give, because the second section's input impedance is part of the first section's load.

There are two remedies. The first is impedance scaling: make each stage's impedance much higher than the one before (here, 16 kΩ and 10 nF for the second section), so that the loading is small; the cutoff comes back to 597.6 Hz. The second, better one is a buffer between stages, an amplifier with a very high input impedance and a very low output impedance, so that each stage sees exactly the load it was designed for. A voltage-follower op-amp does this, and once an amplifier is in the circuit it can do more: active filters such as the Sallen–Key and multiple-feedback circuits produce second-order responses, with any Q you choose, from resistors and capacitors alone, avoiding inductors, which are bulky, lossy and pick up magnetic interference at audio frequencies. (A passive 50 Hz notch with a 10 µF capacitor would need an inductor of about 1 H.) Operational amplifiers builds them.

ExplanationH

Filters in practice

Loudspeaker crossovers. A two-way speaker sends the output of a low-pass filter to the woofer and of a high-pass filter to the tweeter, with the same crossover frequency, typically somewhere between 1.5 and 3 kHz. The first-order pair has a lovely property: 11+jx+jx1+jx=1\frac{1}{1 + jx} + \frac{jx}{1 + jx} = 1 exactly, so the two acoustic outputs add back to the original signal (if the drivers were ideal and in the same place). But first-order slopes of 20 dB per decade send a lot of energy to each driver outside its range, so most designs use steeper filters. A widely used choice is the fourth-order Linkwitz–Riley crossover, described by Siegfried Linkwitz in 1976, built from two cascaded second-order Butterworth sections per output, whose outputs are −6 dB each at the crossover and sum to a flat magnitude. Passive crossovers between an amplifier and the drivers must also cope with the fact that a loudspeaker's impedance is far from a constant resistance, which is why many modern designs filter at line level, actively or digitally, with one amplifier per driver.

Anti-aliasing. A converter that samples at rate fsf_s cannot tell a frequency ff from fs−ff_s - f (Sampling and the FFT explains why), so anything above fs/2f_s/2 must be removed before sampling. A first-order filter is rarely enough: our design leaves a 5 kHz interferer only 14 dB weaker, while a 12-bit converter resolves about 72 dB. Early CD players, sampling at 44.1 kHz for audio up to 20 kHz, needed steep, high-order analog filters squeezed into that narrow gap. Most modern audio and many measurement converters avoid the problem by oversampling: a sigma-delta converter samples far above the Nyquist rate, so a simple RC filter suffices in front of it, and a sharp digital filter (Digital filters) does the rest after the conversion.

Tools and families. Engineers rarely derive high-order filters by hand. Standard families trade one property for another: Butterworth (maximally flat passband), Chebyshev (steeper roll-off at the price of ripple), Bessel (nearly constant time delay, so pulses keep their shape) and elliptic or Cauer (the steepest, with ripple in both bands). Design tables and free online tools from converter and amplifier manufacturers produce component values; SPICE checks the design with real component models; and on the bench, a network analyser or an audio analyser measures the actual frequency response. The first LC filters were invented around 1915, independently by George Campbell at AT&T and Karl Willy Wagner in Germany, for carrying several telephone conversations on one line; Stephen Butterworth described his maximally flat response in 1930; and Hendrik Bode, at Bell Labs, made the straight-line plots that bear his name standard in the 1930s and 1940s, while designing the feedback amplifiers that Feedback control returns to.

Common misconceptionsH

Common misconceptions

Misconception

"A low-pass filter blocks everything above its cutoff." At the cutoff the gain is only 3 dB down, and a first-order filter is just 20 dB down a whole decade higher. A frequency twice the cutoff still passes at 45% of its amplitude (−7 dB). Steep rejection needs higher-order filters.

Misconception

"Decibels of a voltage ratio are 10log⁡1010\log_{10}." That is the formula for power ratios. For voltage or current ratios use 20log⁡1020\log_{10}, so that a voltage ratio and the corresponding power ratio give the same number of decibels.

Misconception

"Two identical RC filters in a row give the same cutoff with twice the slope." Even with an ideal buffer between them, the cascade is already 6.02 dB down at the original cutoff, and its −3 dB point falls to 0.644 of it. Without a buffer, the second stage loads the first and the cutoff falls further, to 0.374 of the single-stage value in our example.

Misconception

"A passive filter can never make a voltage bigger." It cannot deliver more power than it receives, but a resonant RLC filter can raise a voltage: the second-order low-pass above has a gain of +19.93 dB (about 10 times) at its resonance. Q times the input voltage across a capacitor is a real voltage, as the RLC lesson warned.

Misconception

"The Bode asymptotes are the response." They are a sketch. For a first-order filter they are wrong by 3 dB at the corner. For a second-order filter with high Q they miss the resonant peak entirely: the asymptotes meet at 0 dB at ω0\omega_0, while the true gain there is 20log⁡10Q20\log_{10}Q.

Exercises

Exercises

1. Frequency response, Bode plots and filters

Warm-upHuman

A filter passes a sinusoid at one hundredth of its input amplitude: ∣H∣=0.01|H| = 0.01. What is its gain at that frequency in decibels?

2. Frequency response, Bode plots and filters

Warm-upHuman

An RC low-pass filter uses a 3.3 kΩ resistor and a 47 nF capacitor. What is its cutoff frequency in hertz, to the nearest whole hertz?

3. Frequency response, Bode plots and filters

CoreHuman

A first-order low-pass filter has its cutoff at fcf_c. What is its gain at 20fc20 f_c, in decibels, rounded to the nearest whole number?

4. Frequency response, Bode plots and filters

CoreHuman

A two-way loudspeaker uses a first-order low-pass filter for the woofer and a first-order high-pass filter for the tweeter, both with the same crossover frequency fcf_c. Treating the drivers as ideal and in the same place, what is the sum of the two transfer functions, HLP+HHPH_\text{LP} + H_\text{HP}, at the crossover frequency?

Choose one

5. Frequency response, Bode plots and filters

CoreHuman

An RC low-pass filter with R=10R = 10 kΩ and C=16C = 16 nF has a cutoff of 995 Hz when nothing is connected to it. Its output is now connected to an amplifier whose input resistance is 10 kΩ. What happens?

Choose one

6. Frequency response, Bode plots and filters

CoreComputational

Write cutoff(H, f_lo, f_hi). H is a function that takes a frequency in hertz and returns the complex transfer function there; f_lo is a frequency in the passband and f_hi one in the stopband. Return the −3 dB frequency: where ∣H∣|H| has fallen to 1/21/\sqrt2 of ∣H(flo)∣|H(f_\text{lo})|, accurate to better than 0.01%.

The tests use an RC low-pass, two loaded RC sections, an RLC low-pass with Q=1Q = 1 (whose gain rises above 1 before it falls) and a filter whose passband gain is 5.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

7. Frequency response, Bode plots and filters

StretchComputational

Write best_rc(fc_target, capacitors, r_min=1e3, r_max=1e5) for designing an RC filter with preferred values. Search every E24 resistor value between r_min and r_max (inclusive) and every capacitor in the list capacitors (in farads), and return the tuple (R, C, fc) whose cutoff fc=1/(2πRC)f_c = 1/(2\pi RC) has the smallest relative error from fc_target. Return None if no E24 value lies in the resistor range. The E24 mantissas are provided.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources

  • MIT OpenCourseWare 6.003: Signals and Systems · Dennis Freeman · 2011Free lectures and notes on frequency response, Bode plots and filters.
  • ngspice documentationThe manual of the open-source simulator used for the SPICE check, including the .ac analysis and the meas command.
  • Network Analysis and Feedback Amplifier Design · Hendrik W. Bode · 1945The Bell Labs book that made the asymptotic gain and phase plots standard engineering practice.
  • On the theory of filter amplifiers · Stephen Butterworth · 1930The paper that introduced the maximally flat filter response that still bears his name.
  • Linkwitz Lab · Siegfried LinkwitzNotes on loudspeaker and crossover design from the engineer behind the Linkwitz–Riley crossover.
  • Analog DevicesA converter and amplifier manufacturer whose application notes and online design tools cover anti-aliasing and active filters; Texas Instruments and other manufacturers publish similar material.