The fundamental formula for power gain calculation in dB is 10 × log10(Pout / Pin), and for voltage or current gain it is 20 × log10(Vout / Vin). Decibels compress massive linear ratios into manageable additive numbers, but applying the wrong multiplier (10 vs. 20) or mixing absolute and relative units will silently wreck your link budget or audio noise floor calculations.

The Core Formulas and Symbol Definitions

The decibel (dB) is a logarithmic unit used to express the ratio of two physical quantities, usually power or amplitude. The choice between the factor of 10 and the factor of 20 is dictated by the physical quantity being measured.

Power Gain Formula:
Gain (dB) = 10 × log10(Pout / Pin)

Voltage/Current Gain Formula:
Gain (dB) = 20 × log10(Vout / Vin)
Gain (dB) = 20 × log10(Iout / Iin)

Symbol Definition Standard Units
dBDecibel (dimensionless ratio when used for gain)None (logarithmic ratio)
Pout, PinOutput and Input PowerWatts (W), milliwatts (mW)
Vout, VinOutput and Input Voltage (must be RMS for AC)Volts (V), millivolts (mV)
Iout, IinOutput and Input CurrentAmperes (A), milliamperes (mA)
log10Base-10 logarithmNone

When the Formula Applies and Core Assumptions

These formulas apply strictly to Linear Time-Invariant (LTI) systems operating in steady-state AC or RF conditions. They do not apply to transient spikes or heavily clipped non-linear signals. The critical assumption when equating voltage gain to power gain is that input and output impedances are identical (e.g., a 50 Ω RF chain). If Zin ≠ Zout (such as a high-impedance op-amp driving a low-impedance speaker), a +20 dB voltage gain does not equal a +20 dB power gain. For authoritative derivations on this impedance dependency, refer to the Analog Devices guide on decibels.

Rearranged Forms: Solving for Unknowns

On the bench, you rarely just calculate the dB. Usually, you have a datasheet specifying a +34 dB gain block and need to find the maximum input before clipping. Here are the algebraic rearrangements solving for every variable.

  • Solve for Pout: Pout = Pin × 10(dB / 10)
  • Solve for Pin: Pin = Pout / 10(dB / 10)
  • Solve for Vout: Vout = Vin × 10(dB / 20)
  • Solve for Vin: Vin = Vout / 10(dB / 20)

Worked Examples with Unit Tracking

Abstract math fails on the workbench. Here are two real-world scenarios with explicit unit tracking to ensure your magnitudes align.

Problem 1: RF Power Amplifier (Power Domain)

Scenario: You are testing a 50 Ω RF amplifier chain. Your signal generator outputs 2.5 mW. The spectrum analyzer at the amplifier output reads 400 mW. What is the power gain in dB?

  1. Identify knowns: Pin = 2.5 mW, Pout = 400 mW.
  2. Select formula: Gain = 10 × log10(Pout / Pin).
  3. Substitute and track units: Gain = 10 × log10(400 mW / 2.5 mW).
  4. Cancel units inside the log: Gain = 10 × log10(160). (The 'mW' cancels out, leaving a dimensionless ratio, which is required for logarithms).
  5. Calculate log: log10(160) ≈ 2.204.
  6. Final multiplication: 10 × 2.204 = +22.04 dB.

Problem 2: Audio Line Attenuator (Voltage Domain)

Scenario: A passive DI box steps down a speaker-level signal to mic-level. The input is 15 VRMS and the output is 0.15 VRMS. What is the voltage attenuation?

  1. Identify knowns: Vin = 15 VRMS, Vout = 0.15 VRMS.
  2. Select formula: Gain = 20 × log10(Vout / Vin).
  3. Substitute: Gain = 20 × log10(0.15 V / 15 V).
  4. Cancel units: Gain = 20 × log10(0.01).
  5. Calculate log: log10(0.01) = -2.
  6. Final multiplication: 20 × -2 = -40 dB.

Note: The negative sign explicitly denotes attenuation (loss), not a calculation error.

Common Unit Mistakes That Break the Math

Warning: Mixing up the following units is the #1 cause of failed RF link budgets and clipped audio interfaces.
  • Peak vs. RMS Voltage: The 20 × log10 formula requires RMS values for AC signals. If you mix a Peak-to-Peak oscilloscope reading for Vout with an RMS multimeter reading for Vin, your dB calculation will be off by exactly 6 dB (a factor of 2 in voltage).
  • dB vs. dBm / dBu: 'dB' is a relative ratio (gain/loss). 'dBm' and 'dBu' are absolute power/voltage levels referenced to 1 mW and 0.775 V, respectively. You cannot plug a dBm value directly into the Pin slot of the ratio formula without converting it back to linear Watts first.
  • Ignoring Impedance in V-to-P Conversions: In audio, a bridging interface means Zout << Zin. The voltage transfers efficiently, but power transfer is intentionally minimized. Using the power formula on audio voltage readings without accounting for the distinct input and output impedances will yield mathematically correct but physically meaningless power gain numbers. For deeper context on audio vs RF impedance practices, see the Electronics Tutorials decibel guide.

Decision Tree: Picking the Right dB Metric and Component

Use this decision path to select the correct absolute dB metric for your system and terminate with a concrete component selection for your next build.

Condition (IF) Action (THEN) Concrete Component Pick
System is Coaxial RF / Microwave (50 Ω) Use dBm (Ref: 1 mW). Calculate power budgets. Mini-Circuits GALI-74+ (Darlington amp, +20 dBm P1dB, DC-8 GHz)
System is Pro Audio / Studio (Balanced XLR/TRS) Use dBu (Ref: 0.775 V). Calculate headroom. Focusrite Scarlett 2i2 (4th Gen) (+4 dBu nominal line I/O, 120 dB dynamic range)
System is Consumer Audio (Unbalanced RCA) Use dBV (Ref: 1.0 V). Match -10 dBV standards. TI OPA1678 (Audio op-amp, optimized for -10 dBV line levels)
System is Fiber Optic / Photodiode Use dBm (Optical power). Never use voltage dB. Thorlabs PDA10A2 (Switchable gain TIA, calibrated in dBm optical)

Default Recommendation: If you are building a custom PCB and are unsure which standard to follow, default to dBm for any 50 Ω RF trace and dBu for any differential audio trace. Design your gain stages to hit +4 dBu (1.228 VRMS) for audio line drivers, and +15 dBm (31.6 mW) for standard RF mixer LO ports.

Realistic Answer Magnitudes (Rule of Thumb Chart)

When reviewing a simulation or taking a quick bench measurement, you need to instantly recognize if a dB value makes physical sense. Memorize these anchor points to catch decimal errors before they reach the PCB layout stage.

dB Value Power Multiplier (10x log) Voltage/Current Multiplier (20x log) Real-World Context
+3 dB2x1.414x (√2)Doubling transmitter power; -3dB cutoff frequency of a filter.
+6 dB4x2xDoubling voltage amplitude; two identical incoherent noise sources combining.
+10 dB10x3.16xOne order of magnitude increase in power.
+20 dB100x10xStandard gain block for an IF amplifier stage.
-20 dB0.01x0.1xDirectional coupler coupling factor; heavy passive attenuation.
-3 dB0.5x0.707xHalf power point; standard definition for filter bandwidth.

By strictly separating the 10-log power domain from the 20-log amplitude domain, tracking your linear units before applying the logarithm, and selecting the correct absolute reference (dBm vs dBu), your gain calculations will perfectly match your bench measurements every time.