TExcelTAD
Home › Circuit Theory & Network Analysis › Decibels and Bode Plots

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

GdB=20log⁡10∣H∣(voltage or current ratio),GdB=10log⁡10P2P1(power ratio)G_\text{dB} = 20 \log_{10} \lvert H \rvert \quad \text{(voltage or current ratio)}, \qquad G_\text{dB} = 10 \log_{10} \frac{P_2}{P_1} \quad \text{(power ratio)}

The two agree when both voltages sit across equal resistances, because power goes as voltage squared. Numbers worth knowing by heart:

ratio ∣H∣\lvert H \rvert dB ratio dB
1010 +20+20 1/2=0.7071/\sqrt{2} = 0.707 −3.01-3.01
22 +6.02+6.02 0.50.5 −6.02-6.02
100100 +40+40 0.10.1 −20-20
11 00 0.0010.001 −60-60

Because log⁡(ab)=log⁡a+log⁡b\log(ab) = \log a + \log b, cascaded gains add in dB: a +40 dB+40\ \text{dB} amplifier followed by a −6 dB-6\ \text{dB} divider is +34 dB+34\ \text{dB} 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; −20 dB/decade-20\ \text{dB/decade} is the same slope as −6 dB/octave-6\ \text{dB/octave}.

Building blocks in standard form

Write the transfer function as a product of simple factors with the corner frequencies showing:

H(s)=K (1+s/ωz1)⋯(1+s/ωp1)(1+s/ωp2)⋯,s=jωH(s) = K \, \frac{(1 + s/\omega_{z1}) \cdots}{(1 + s/\omega_{p1})(1 + s/\omega_{p2}) \cdots}, \qquad s = j\omega

Each factor has a simple Bode picture:

factor magnitude asymptotes phase asymptotes
constant KK flat at 20log⁡10K20\log_{10} K 0∘0^\circ (−180∘-180^\circ if K<0K < 0)
pole 1/(1+s/ωp)1/(1 + s/\omega_p) 0 dB0\ \text{dB} up to ωp\omega_p, then −20 dB/decade-20\ \text{dB/decade} 0∘0^\circ below ωp/10\omega_p/10, −90∘-90^\circ above 10ωp10\omega_p, a straight ramp between, −45∘-45^\circ at ωp\omega_p
zero 1+s/ωz1 + s/\omega_z 0 dB0\ \text{dB} up to ωz\omega_z, then +20 dB/decade+20\ \text{dB/decade} 0∘0^\circ to +90∘+90^\circ, the mirror image
pole at the origin 1/s1/s −20 dB/decade-20\ \text{dB/decade} everywhere, 0 dB0\ \text{dB} at ω=1\omega = 1 −90∘-90^\circ
quadratic pole pair (ζ\zeta, ωn\omega_n) flat, then −40 dB/decade-40\ \text{dB/decade} from ωn\omega_n; a peak near ωn\omega_n if ζ<0.707\zeta < 0.707 0∘0^\circ to −180∘-180^\circ, steeper for small ζ\zeta

The exact curve of a real pole differs from its asymptotes by at most 3.01 dB3.01\ \text{dB} (at the corner, where ∣H∣=1/2\lvert H \rvert = 1/\sqrt{2}) and 1 dB1\ \text{dB} an octave either side; its phase differs from the ramp by at most 5.7∘5.7^\circ, at ωp/10\omega_p/10 and 10ωp10\omega_p. Quadratic factors belong to Second-Order Passive Filters.

Sketching recipe

  1. Put HH in standard form and list the corners in increasing order.
  2. Start at low frequency with the constant (plus −20 dB/decade-20\ \text{dB/decade} per pole at the origin).
  3. Walk up in frequency: at each pole the slope drops by 20 dB/decade20\ \text{dB/decade}, at each zero it rises by 20.
  4. Add the phase ramps, each spanning a decade below to a decade above its corner.
  5. Round the corners: −3 dB-3\ \text{dB} at an isolated pole, +3 dB+3\ \text{dB} at a zero.
10 100 1k 10k 100k 1M -100 -50 0 50 |H| (dB) -20 dB/dec -40 -60 f1 f2 f3 10 100 1k 10k 100k 1M -270 -180 -90 0 phase (deg) f (Hz) exact asymptotes

Worked example

Given: an amplifier with H(s)=100(1+s/ω1)(1+s/ω2)(1+s/ω3)H(s) = \dfrac{100}{(1 + s/\omega_1)(1 + s/\omega_2)(1 + s/\omega_3)}, f1=100 Hzf_1 = 100\ \text{Hz}, f2=10 kHzf_2 = 10\ \text{kHz}, f3=100 kHzf_3 = 100\ \text{kHz}.

Find: the asymptotic and exact gain at 1 kHz1\ \text{kHz} and 10 kHz10\ \text{kHz}, and the phase at 1 kHz1\ \text{kHz}.

Solve: 20log⁡10100=40 dB20\log_{10} 100 = 40\ \text{dB}. One decade past f1f_1 the asymptote has fallen 20 dB20\ \text{dB}: 20 dB20\ \text{dB} at 1 kHz1\ \text{kHz}, 0 dB0\ \text{dB} at 10 kHz10\ \text{kHz}. Exact values sum each factor's −10log⁡10(1+(f/fk)2)-10\log_{10}(1 + (f/f_k)^2):

G(1 kHz)=40−10log⁡10(1+102)−10log⁡10(1+0.12)−10log⁡10(1+0.012)=40−20.04−0.04−0.00=19.91 dBG(10 kHz)=40−10log⁡10(1+1002)−10log⁡10(2)−10log⁡10(1.01)=40−40.00−3.01−0.04=−3.05 dB∠H(1 kHz)=−arctan⁡10−arctan⁡0.1−arctan⁡0.01=−84.29∘−5.71∘−0.57∘=−90.57∘\begin{aligned} G(1\ \text{kHz}) &= 40 - 10\log_{10}(1 + 10^2) - 10\log_{10}(1 + 0.1^2) - 10\log_{10}(1 + 0.01^2) = 40 - 20.04 - 0.04 - 0.00 = 19.91\ \text{dB} \\ G(10\ \text{kHz}) &= 40 - 10\log_{10}(1 + 100^2) - 10\log_{10}(2) - 10\log_{10}(1.01) = 40 - 40.00 - 3.01 - 0.04 = -3.05\ \text{dB} \\ \angle H(1\ \text{kHz}) &= -\arctan 10 - \arctan 0.1 - \arctan 0.01 = -84.29^\circ - 5.71^\circ - 0.57^\circ = -90.57^\circ \end{aligned}

Check: at 10 kHz10\ \text{kHz} the exact value is about 3 dB3\ \text{dB} under the asymptote, the usual correction at a corner (f2f_2). Between f1f_1 and f2f_2 the phase stays near −90∘-90^\circ: 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.

python · try it yourself
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 3 dB3\ \text{dB}, 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.

6040200-20-40-60-80|L| (dB)-270-180-90090100m1101001k10k100k1Mf (Hz)phase (deg)PM 48.1 degGM 20.9 dB|L| exactphase exactasymptotesunity-feedback closed loop: stable

The readouts give ∣H∣=19.91 dB\lvert H \rvert = 19.91\ \text{dB} and ∠H=−90.6∘\angle H = -90.6^\circ at 1 kHz1\ \text{kHz}. Turn on the zero and move it: the slope bends back up by 20 dB/decade20\ \text{dB/decade} above fzf_z, and the phase recovers by up to 90∘90^\circ. (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, R=10 kΩR = 10\ \text{k}\Omega, C=10 nFC = 10\ \text{nF}: fc=1/(2πRC)=1.59 kHzf_c = 1/(2\pi R C) = 1.59\ \text{kHz}. Expected: 0 dB0\ \text{dB} below about 160 Hz, −3 dB-3\ \text{dB} and −45∘-45^\circ at 1.59 kHz1.59\ \text{kHz}, −20.0 dB-20.0\ \text{dB} at 15.9 kHz15.9\ \text{kHz}, −40.0 dB-40.0\ \text{dB} at 159 kHz159\ \text{kHz}, the phase approaching −90∘-90^\circ.

Simulation. Replace poles_hz by [1591.5] and the gain by 1.0 in the code above.

What you would measure. Function generator at 2 V2\ \text{V} peak-to-peak, scope on input and output, frequencies at 1-2-5 steps from 100 Hz to 200 kHz. Compute 20log⁡10(Vout/Vin)20\log_{10}(V_\text{out}/V_\text{in}) and plot on a log axis. Expect the points on a −20 dB/decade-20\ \text{dB/decade} line above fcf_c to within about ±0.5 dB\pm 0.5\ \text{dB} (3 % scope accuracy is 0.26 dB0.26\ \text{dB}). Below about −40 dB-40\ \text{dB} the output is only 20 mV20\ \text{mV} 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 20log⁡1020\log_{10}; power ratios use 10log⁡1010\log_{10}. Using 10 for a voltage ratio halves every dB value.
  • Hz versus rad/s on the axis. scipy.signal.bode works in rad/s; corner frequencies in Hz must be multiplied by 2π2\pi.
  • 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 360∘360^\circ is a display artefact; np.unwrap fixes it.

Practice

  1. Convert to dB: a voltage gain of 0.05; a power gain of 2000.
  2. Sketch H(s)=10(1+s/ωz)/(1+s/ωp)H(s) = 10(1 + s/\omega_z)/(1 + s/\omega_p) with fz=100 Hzf_z = 100\ \text{Hz}, fp=1 kHzf_p = 1\ \text{kHz}. What is the gain at high frequency?
  3. How many dB does the exact gain of a single pole lie below its asymptote one octave above the corner?
Answer
  1. 20log⁡100.05=−26.0 dB20\log_{10} 0.05 = -26.0\ \text{dB}; 10log⁡102000=33.0 dB10\log_{10} 2000 = 33.0\ \text{dB}.
  2. Flat at 20 dB20\ \text{dB} to 100 Hz100\ \text{Hz}, rising +20 dB/decade+20\ \text{dB/decade} to 1 kHz1\ \text{kHz} (40 dB40\ \text{dB}), flat again above. High-frequency gain 10⋅(1000/100)=10010 \cdot (1000/100) = 100, 40 dB40\ \text{dB}.
  3. At f=2fpf = 2f_p: exact −10log⁡10(1+4)=−6.99 dB-10\log_{10}(1 + 4) = -6.99\ \text{dB}, asymptote −20log⁡102=−6.02 dB-20\log_{10} 2 = -6.02\ \text{dB}: 0.97 dB0.97\ \text{dB} below.

Test yourself

What is a voltage gain of 1000 in decibels?

  1. 30 dB30\ \text{dB}
  2. 60 dB60\ \text{dB}
  3. 100 dB100\ \text{dB}
  4. 1000 dB1000\ \text{dB}

Above two real poles and below the third, the magnitude asymptote falls at…

  1. −20 dB/decade-20\ \text{dB/decade}
  2. −40 dB/decade-40\ \text{dB/decade}
  3. −6 dB/decade-6\ \text{dB/decade}
  4. −60 dB/decade-60\ \text{dB/decade}

At the corner frequency of a single real pole, the exact gain is below the asymptote by about…

  1. 0 dB0\ \text{dB}
  2. 1 dB1\ \text{dB}
  3. 3 dB3\ \text{dB}
  4. 6 dB6\ \text{dB}

Over which range does the phase of a single real pole at fpf_p change, in the straight-line approximation?

  1. only at fpf_p
  2. from fp/10f_p/10 to 10fp10 f_p
  3. from fp/2f_p/2 to 2fp2 f_p
  4. from 0 to fpf_p