Decibels and Bode Plots
An amplifier datasheet shows a gain curve that is flat at 40 dB, bends down near 100 Hz, and falls ever more steeply above 10 kHz. You can sketch such a curve by hand in two minutes, and read the circuit's poles straight off it, if you plot it the way Hendrik Bode did in the 1930s: gain in decibels and frequency on a logarithmic axis. On those axes every pole and zero becomes a straight-line segment, and the whole response is just their sum. This lesson builds the sketching rules and checks them against an exact computation.
Decibels
A gain in decibels is
The two agree when both voltages sit across equal resistances, because power goes as voltage squared. Numbers worth knowing by heart:
| ratio | dB | ratio | dB |
|---|---|---|---|
Because , cascaded gains add in dB: a amplifier followed by a divider is in total, as long as the second stage does not load the first. Phases of cascaded stages add as well. A decade is a factor of 10 in frequency, an octave a factor of 2; is the same slope as .
Building blocks in standard form
Write the transfer function as a product of simple factors with the corner frequencies showing:
Each factor has a simple Bode picture:
| factor | magnitude asymptotes | phase asymptotes |
|---|---|---|
| constant | flat at | ( if ) |
| pole | up to , then | below , above , a straight ramp between, at |
| zero | up to , then | to , the mirror image |
| pole at the origin | everywhere, at | |
| quadratic pole pair (, ) | flat, then from ; a peak near if | to , steeper for small |
The exact curve of a real pole differs from its asymptotes by at most (at the corner, where ) and an octave either side; its phase differs from the ramp by at most , at and . Quadratic factors belong to Second-Order Passive Filters.
Sketching recipe
- Put in standard form and list the corners in increasing order.
- Start at low frequency with the constant (plus per pole at the origin).
- Walk up in frequency: at each pole the slope drops by , at each zero it rises by 20.
- Add the phase ramps, each spanning a decade below to a decade above its corner.
- Round the corners: at an isolated pole, at a zero.
Worked example
Given: an amplifier with , , , .
Find: the asymptotic and exact gain at and , and the phase at .
Solve: . One decade past the asymptote has fallen : at , at . Exact values sum each factor's :
Check: at the exact value is about under the asymptote, the usual correction at a corner (). Between and the phase stays near : one pole has finished turning, the next has barely started.
In Python
scipy.signal.bode evaluates an lti system on a list of angular frequencies. The asymptote is coded from the recipe.
import numpy as np
from scipy import signal
poles_hz = [100.0, 1e4, 1e5]
den = np.array([1.0])
for fp in poles_hz:
den = np.polymul(den, [1 / (2 * np.pi * fp), 1]) # (1 + s/wp)
sys = signal.lti([100.0], den)
f = np.array([10, 100, 1e3, 1e4, 1e5, 1e6])
w, mag, phase = signal.bode(sys, w=2 * np.pi * f)
asym = 40 - sum(np.where(f > fp, 20 * np.log10(f / fp), 0) for fp in poles_hz)
print(" f (Hz) exact dB asymptote dB phase (deg)")
for fi, m, a, p in zip(f, mag, asym, phase):
print(f"{fi:11.0f} {m:9.2f} {a:13.1f} {p:12.2f}") f (Hz) exact dB asymptote dB phase (deg)
10 39.96 40.0 -5.77
100 36.99 40.0 -45.63
1000 19.91 20.0 -90.57
10000 -3.05 0.0 -140.14
100000 -43.05 -40.0 -219.23
1000000 -100.04 -100.0 -263.71
The largest error of the straight lines is about , at the corners. For design that is usually close enough; the sketch tells you which corner to compute exactly.
Interactive: a Bode plot with sliders
The Bode lab draws the exact curves (solid) and the asymptotes (dashed) for one, two or three poles with an optional zero. Set to "3 real poles", it is the worked example.
The readouts give and at . Turn on the zero and move it: the slope bends back up by above , and the phase recovers by up to . (The lab also marks gain and phase margins, which matter when this response sits inside a feedback loop; that is the subject of the planned Control Systems course.)
Guided lab: plot a measured Bode diagram
Hand calculation. A single RC low-pass, , : . Expected: below about 160 Hz, and at , at , at , the phase approaching .
Simulation. Replace poles_hz by [1591.5] and the gain by 1.0 in the code above.
What you would measure. Function generator at peak-to-peak, scope on input and output, frequencies at 1-2-5 steps from 100 Hz to 200 kHz. Compute and plot on a log axis. Expect the points on a line above to within about (3 % scope accuracy is ). Below about the output is only peak-to-peak and scope noise starts to dominate: raise the vertical sensitivity or average.
Hazards and safe setup. Signal levels only. Share one ground between generator, scope and circuit.
Pitfalls
- 20 or 10? Voltage and current ratios use ; power ratios use . Using 10 for a voltage ratio halves every dB value.
- Hz versus rad/s on the axis.
scipy.signal.bodeworks in rad/s; corner frequencies in Hz must be multiplied by . - Adding dB of loaded stages. Gains add in dB only if the stages are buffered. Two identical RC sections in cascade are not two copies of one section (two-port cascades show the difference).
- Phase wraps. A computed phase that jumps by is a display artefact;
np.unwrapfixes it.
Practice
- Convert to dB: a voltage gain of 0.05; a power gain of 2000.
- Sketch with , . What is the gain at high frequency?
- How many dB does the exact gain of a single pole lie below its asymptote one octave above the corner?
Answer
- ; .
- Flat at to , rising to (), flat again above. High-frequency gain , .
- At : exact , asymptote : below.
Test yourself
What is a voltage gain of 1000 in decibels?
Above two real poles and below the third, the magnitude asymptote falls at…
At the corner frequency of a single real pole, the exact gain is below the asymptote by about…
Over which range does the phase of a single real pole at change, in the straight-line approximation?
- only at
- from to
- from to
- from 0 to