×100×0.5×108 Ω−40.00 dBV1import numpy as np2g = np.array([100, 0.5, 10])3db = 20*np.log10(g)4db.sum(), 20*np.log10(g.prod())+40.00 dB−6.02 dB+20.00 dB
micprevolampspk012345position along the chainlevel (V)LINEAR AXIS: VOLTS10 mV ≈ 0 heremicprevolampspk-40-20020position along the chainlevel (dBV)LOG AXIS: dBV+40.00 dB−6.02 dB+20.00 dB+53.98 dB = ×5005 V = +13.98 dBV20 dB = ×10= 1 V= 0.1 V= 10 mVnumpy: 53.98 dB
Coloured parts: what the current step is about; everything else rests in whiteBlocks: microphone, preamp, volume, power amp, speaker, a level meter and a Python code cardPlots: the level along the chain on a linear volts axis and on a log (dBV) axisThe token carries the signal from block to block; tags show each gain in dBA 10 mV signal is multiplied by 100, 0.5, 10: 500 times in all. In decibels the gains 40, -6.02, 20 dB add to 53.98 dB. A real speaker's impedance changes with frequency; here it is treated as a plain 8 Ω resistor so that P = V²/R holds.

Why ratios

  1. 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).

The decibel

A chain of gains

Levels, axes and code

The working

# step 1/10 · range

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)

The 10 mV microphone level is a chosen example; every other number is computed from it in this model. Voltages are rms values. Strictly, 20·log₁₀ of a voltage ratio equals the power ratio in dB only when both voltages are across equal resistances. Engineers still quote a block's voltage gain in dB this way, and so does this lesson.