ENع
←Decibels and log scales
Lesson 07 · Signals and systems in continuous time

Decibels and log scales

12 min10 steps5 questionsBeginner
About this lesson

Signals span huge ranges: a microphone gives millivolts, a speaker needs volts. Decibels compare two sizes as a ratio on a logarithmic scale, so big and small numbers sit side by side and gains along a chain simply add. Follow a 10 mV signal through a preamp (×100), a volume control (×0.5) and a power amp (×10): +40, −6.02 and +20 dB add to 53.98 dB, a gain of 500. You will meet 10·log₁₀ for power, 20·log₁₀ for voltage, the absolute levels dBV and dBm, and do it all in Python with numpy. The Circuits lesson on transfer functions and Bode plots uses these scales next.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 7 · Interactive
01 / 10

Tiny to large

A microphone gives a tiny 10 mV signal. To drive a speaker we need 5 V: 500 times bigger. Signals span huge ranges like this, so engineers compare them as ratios, measured in decibels (dB).

microphone   10 mV  = 0.01 V
speaker      5 V

ratio  5 / 0.01 = 500

mV = millivolt = 0.001 V
voltages here are rms values
(the steady "heating" value of a wave)
Loading figure…
or ← →
Read the lesson step by step
  1. Tiny to large

    A microphone gives a tiny 10 mV signal. To drive a speaker we need 5 V: 500 times bigger. Signals span huge ranges like this, so engineers compare them as ratios, measured in decibels (dB).

    microphone   10 mV  = 0.01 V
    speaker      5 V
    
    ratio  5 / 0.01 = 500
    
    mV = millivolt = 0.001 V
    voltages here are rms values
    (the steady "heating" value of a wave)
  2. A decibel compares two powers

    A decibel compares two powers: dB = 10·log₁₀(P₂/P₁). Ten times the power is +10 dB, a hundred times is +20 dB, double is +3.01 dB, half is −3.01 dB. Equal powers give 0 dB.

    dB = 10·log10(P2 / P1)
    
    log10(x) asks: 10 to what power is x?
      log10(10)  = 1,  log10(100) = 2
    
    ratio     dB
      ×100    +20
      ×10     +10
      ×2      +3.01
      ×1       0
      ×0.5    −3.01
    
    bel = log10 of a power ratio;
    a decibel is a tenth of a bel
  3. Voltage ratios use 20·log

    Power grows with voltage squared: P = V²/R. So for voltages across the same resistance, dB = 20·log₁₀(V₂/V₁). Ten times the voltage is a hundred times the power: +20 dB either way.

    P = V² / R
    
    P2/P1 = (V2/V1)²   (same R)
    10·log10((V2/V1)²) = 20·log10(V2/V1)
    
    voltage ×10   ->  power ×100  ->  +20 dB
    voltage ×2    ->  power ×4    ->  +6.02 dB
    voltage ×0.5  ->  power ×0.25 ->  −6.02 dB
  4. Preamp: ×100 is +40 dB

    The preamp multiplies the voltage by 100: 10 mV becomes 1 V. In decibels its gain is 20·log₁₀(100) = +40 dB. Watch the level climb on both plots below.

    in    10 mV
    gain  ×100
    out   1 V
    
    gain in dB = 20·log10(100)
               = 20 × 2
               = +40 dB
  5. Volume: ×0.5 is −6.02 dB

    The volume control halves the voltage: 1 V becomes 0.5 V. A ratio below 1 has a negative logarithm: 20·log₁₀(0.5) = −6.02 dB. In decibels, a loss is just a negative gain.

    in    1 V
    gain  ×0.5  (two equal resistors:
                a voltage divider)
    out   0.5 V
    
    20·log10(0.5) = −6.02 dB
    
    ratio > 1  ->  dB > 0  (gain)
    ratio = 1  ->  0 dB
    ratio < 1  ->  dB < 0  (loss)
  6. Power amp: ×10 is +20 dB

    The power amp multiplies by 10: 0.5 V becomes 5 V, a gain of +20 dB. On the volts plot the early steps vanish near zero. On the decibel plot every step is easy to see.

    in    0.5 V
    gain  ×10
    out   5 V
    
    20·log10(10) = +20 dB
    
    volts plot: 10 mV is 0.2 % of 5 V,
    flat against the axis
    dB plot:    −40 .. +14 dBV, all clear
  7. Multiply gains, add decibels

    Gains multiply: 100 × 0.5 × 10 = 500. Logarithms turn multiplying into adding: 40 − 6.02 + 20 = 53.98 dB. Check: 20·log₁₀(500) = 53.98 dB. Same answer, using only addition.

    log(a·b) = log(a) + log(b)
    
    gains   100 × 0.5 × 10 = 500
    in dB   40 + (−6.02) + 20 = 53.98 dB
    
    20·log10(500) = 53.98 dB  ✓
    
    adding dB is how engineers
    budget a whole chain in their head
  8. dBV and dBm: absolute levels

    With a fixed reference, dB gives an absolute level. dBV means compared with 1 V: 10 mV is −40 dBV, 5 V is +13.98 dBV. Into 8 Ω, 5 V gives 3.125 W, which is +34.95 dBm (re 1 mW).

    dBV = 20·log10(V / 1 V)
      10 mV ->  20·log10(0.01) = −40 dBV
      5 V   ->  20·log10(5)    = +13.98 dBV
    
    dBm = 10·log10(P / 1 mW)
      P = V²/R = 5² / 8 = 3.125 W
        = 3125 mW
      10·log10(3125) = +34.95 dBm
      (1 W = +30 dBm)
  9. Equal steps, equal ratios

    The meter reads in dB and the right plot uses a log scale. Equal steps mean equal ratios: every 20 dB is ×10 in voltage, every 6.02 dB is ×2. Bode plots also use a log frequency axis.

    dBV axis    voltage
      +20        10 V
        0         1 V
      −20       0.1 V
      −40      10 mV
    
    equal distance = equal ratio
    one decade (×10) = 20 dB of voltage
    
    filters and Bode plots:
    see Circuits, "Transfer functions and Bode plots"
  10. Decibels in Python

    In Python with numpy, np.log10 works on a whole array: one line turns the three gains into decibels. Their sum and 20·log₁₀ of the product both give 53.98 dB.

    import numpy as np
    g = np.array([100, 0.5, 10])
    db = 20*np.log10(g)
    db.sum(), 20*np.log10(g.prod())
    
    >>> db.round(2)
    array([40.  , -6.02, 20.  ])
    >>> db.sum(), 20*np.log10(g.prod())
    (np.float64(53.979400086720375),
     np.float64(53.979400086720375))
    >>> (10**(db.sum()/20)).round()
    np.float64(500.0)
    
    (Python 3 with numpy)

Quiz Unlocks after the last step.