1. Home
  2. Signal processing

Signal processing · units

Decibels: 20·log10 of an Amplitude Ratio

Eigenfield editorial team ·

A decibel expresses a ratio on a logarithmic scale. For amplitudes such as voltage, pressure or a spectrum magnitude, the conversion is dB = 20·log₁₀(ratio). Two small values come up constantly and are worth having at hand: log₁₀(20) = 1.3010, and 20·log₁₀(5) = 13.98 dB. Everything else on this page is a way of getting those numbers and checking them without a calculator. The conversion is used on nearly every plot in signal processing.

Why 20 for amplitudes and 10 for powers

Power is proportional to amplitude squared. The bel, the original unit, is log₁₀ of a power ratio, and a decibel is a tenth of a bel, so the power formula is dB = 10·log₁₀(P2/P1). Substitute P = A² and the rule of logarithms log(A²) = 2·log(A) produces a factor 2:

10·log₁₀(A2²/A1²) = 20·log₁₀(A2/A1)

Applying 10 to an amplitude ratio halves the answer, a common mistake with spectra. A spectrum magnitude in dB uses 20; a power spectral density uses 10.

Working the two values by hand

The logarithm of 20 splits as log₁₀(2 · 10) = log₁₀(2) + 1. With log₁₀(2) = 0.30103, the result is 1.30103, so log₁₀(20) ≈ 1.3010. Multiplied by 20 it gives 26.02 dB, which is the same as 6.02 + 20.

For 20·log₁₀(5), note that 5 = 10/2. Then log₁₀(5) = 1 − 0.30103 = 0.69897, and 20 × 0.69897 = 13.979, or 13.98 dB. A second route gives the same number: 20·log₁₀(10) is 20 dB, and dividing by 2 removes 6.02 dB, leaving 13.98.

A checked table

amplitude ratio dB (20·log₁₀) power ratio dB (10·log₁₀)
0.5 −6.02 0.5 −3.01
1 0 1 0
2 6.02 2 3.01
5 13.98 5 6.99
10 20 10 10
20 26.02 20 13.01
100 40 100 20

Two anchors cover much of practical work. Doubling an amplitude adds 6.02 dB, and every factor of 10 adds 20 dB. A value of −3 dB in amplitude is a factor 10−3/20 = 0.708, close to 1/√2 = 0.7071, which is where the familiar half-power point comes from: half the power is 0.7071 times the amplitude, and 20·log₁₀(0.7071) = −3.01 dB.

Going back

The inverse for amplitudes is ratio = 10dB/20. A gain of 14 dB is 100.7 = 5.012 in amplitude, which fits with the 13.98 dB found for a ratio of 5. A stopband specified at −40 dB corresponds to an amplitude factor of 0.01, which is how attenuation targets are set in analog filter design and why the sidelobe figures in the Blackman window article are quoted in dB.

Cautions

The logarithm of zero is minus infinity, so a spectrum with exact zeros produces −∞ entries and plotting routines warn about them. The standard remedy is to add a tiny floor such as 10⁻¹² to the magnitude before taking the logarithm, or to plot with a lower limit on the axis. Note that the floor adds an arbitrary level to the plot, so quote it when it matters.

Decibels are relative, so a bare figure such as 13.98 dB says nothing until a reference is given. Suffixed variants fix the reference: dBV is relative to one volt, dBm to one milliwatt, and dBFS to the full-scale value of a digital system. In a noise simulation the reference is the signal power, as in additive white Gaussian noise.

Pseudocode

function to_db_amplitude(a):   return 20 * log10(a)
function to_db_power(p):       return 10 * log10(p)
function from_db_amplitude(d): return 10 ^ (d / 20)
Back to top