---
title: Distortion
heading: Harmonics and intermodulation from a transfer curve, and how feedback shrinks them
eyebrow: S2 · Lesson 33 · Distortion
xp: 50
---

::: hook
Every amplifier's transfer curve bends a little, and the bends turn a pure tone into a tone plus harmonics, and two tones into a crowd of intermodulation products that can land right on top of a weak signal next door. A designer predicts all of it from the first few coefficients of the curve's Taylor series. For the differential pair those coefficients come straight from its large-signal law, which shows why a MOS pair at high overdrive is so much cleaner than a bipolar pair, and how much loop gain it takes to clean either one up.
:::

::: play
- The output spectrum, in dB, of a bipolar differential pair (solid) and a MOS pair with overdrive $V_{ov}$ (dashed), each driven by a 500 Hz sine of amplitude A. Both are differential, so only odd harmonics appear.
- Double A and the third harmonic rises by 12 dB relative to the fundamental: HD3 grows as $A^2$.
- The readouts give the predicted HD3 from the Taylor coefficients. Raise $V_{ov}$ to watch the MOS pair's distortion fall as $1/V_{ov}^2$.
:::
:::

```sim plot
view: spectrum
x: t = 0..10m s
y: i = -1.1..1.1
slider: A = 2..60 = 10 mV
slider: Vov = 100..400 = 200 mV
plot: tanh(A*sin(2*pi*500*t)/51.7) | label: bipolar pair
plot: (A*sin(2*pi*500*t)/Vov)*sqrt(abs(1 - (A*sin(2*pi*500*t))^2/(4*Vov^2))) | dashed | label: MOS pair
samples: 1024
freq: f = 0..3k Hz
scale: db
readout: bipolar HD3, dB = 20*log(A^2/(48*25.85^2))
readout: MOS HD3, dB = 20*log(A^2/(32*Vov^2))
```

::: predict
## A bipolar differential pair is driven with a 10 mV sine and shows −50 dB of third harmonic. What happens at 20 mV?

- [ ] Still −50 dB
- [ ] −44 dB
- [x] −38 dB
- [ ] −30 dB

::: reveal
−38 dB. The third harmonic's amplitude grows as the cube of the input and the fundamental as the input itself, so their ratio grows as $A^2$: doubling A raises HD3 by a factor of 4, 12 dB. Second-order products grow 6 dB per doubling. That slope is how you recognize which term is responsible on a measured spectrum.
:::
:::

::: nameit
## Harmonics from a Taylor series

Write a stage's output as $y = a_1x + a_2x^2 + a_3x^3 + \ldots$. With $x = A\cos\omega t$:

$$\text{HD2} = \frac{1}{2}\left|\frac{a_2}{a_1}\right|A, \qquad \text{HD3} = \frac{1}{4}\left|\frac{a_3}{a_1}\right|A^2$$

relative to the fundamental.

## Intermodulation and intercept

Two tones $A\cos\omega_1t + A\cos\omega_2t$ produce third-order products at $2\omega_1 - \omega_2$ and $2\omega_2 - \omega_1$, close to the tones, with relative size

$$\text{IM3} = \frac{3}{4}\left|\frac{a_3}{a_1}\right|A^2 = 3\,\text{HD3}$$

The **third-order intercept** is the input amplitude at which the extrapolated IM3 products would equal the fundamentals: $A_{IIP3} = \sqrt{\frac{4}{3}\left|\frac{a_1}{a_3}\right|}$. Above it in dB, IM3 rises 3 dB for every 1 dB of input.

## Differential pairs

- Bipolar: $\tanh\frac{v}{2V_T} \approx \frac{v}{2V_T} - \frac{1}{3}\left(\frac{v}{2V_T}\right)^3$, so $\text{HD3} = \frac{A^2}{48V_T^2}$: −50 dB at 10 mV.
- MOS (square law): $\frac{v}{V_{ov}}\sqrt{1 - \frac{v^2}{4V_{ov}^2}} \approx \frac{v}{V_{ov}} - \frac{v^3}{8V_{ov}^3}$, so $\text{HD3} = \frac{A^2}{32V_{ov}^2}$: −82 dB at 10 mV with $V_{ov}$ = 0.2 V.

## Feedback

A loop gain T divides each harmonic, to first order, by $1 + T$ (degeneration is local feedback with $T = g_mR_S$). Feedback also mixes orders: a second-order term inside a loop generates new third-order distortion, so a circuit with large HD2 can't be fixed by feedback alone; differential symmetry removes it first.
:::

::: example
## Compare the third harmonic of a bipolar pair and a MOS pair at $V_{ov}$ = 0.2 V, each driven with 10 mV. What loop gain brings the bipolar pair down to the MOS pair's level?

::: solution
1. **Bipolar pair.**
   $$\begin{aligned} \text{HD}_3 &= \frac{(0.01)^2}{48 \times 0.02585^2} \\ &= 3.1 \times 10^{-3} \end{aligned}$$
   or −50 dB (a numerical harmonic analysis of the tanh gives −50.2 dB).
2. **MOS pair.**
   $$\begin{aligned} \text{HD}_3 &= \frac{(0.01)^2}{32 \times 0.2^2} \\ &= 7.8 \times 10^{-5} \end{aligned}$$
   or −82 dB.
3. **Loop gain to match.** The gap is 32 dB, so closing the bipolar pair inside a loop gain of about 40 would match the MOS pair:
   $$10^{32/20} \approx 40$$
4. **Why the bipolar pair can afford it.** It has more $g_m$ per current, so it has the loop gain to spare.

**Answer:** −50 dB for the bipolar pair and −82 dB for the MOS pair; a loop gain of about 40 (32 dB) brings the bipolar pair down to match.
:::
:::

::: example
## A stage has $a_1$ = 1 and $a_3$ = −0.1 V⁻². Find its input-referred third-order intercept and its IM3 at 0.2 V per tone.

::: solution
1. **Intercept.**
   $$\begin{aligned} A_{IIP3} &= \sqrt{\frac{4}{3} \times \frac{1}{0.1}} \\ &= 3.65\ \text{V} \end{aligned}$$
2. **IM3 at 0.2 V per tone.**
   $$\begin{aligned} \text{IM3} &= \frac{3}{4} \times 0.1 \times 0.04 \\ &= 0.003 \end{aligned}$$
   or −50.5 dBc.
3. **Check.** The intercept relation gives the same:
   $$\begin{aligned} \text{IM3} &= (A/A_{IIP3})^2 \\ &= (0.2/3.65)^2 \\ &= 0.003 \end{aligned}$$

**Answer:** the input-referred intercept is 3.65 V, and IM3 is 0.003 (−50.5 dBc) at 0.2 V per tone.
:::
:::

::: example
## Why does a fully differential stage cancel its second harmonic, and what limits the cancellation?

::: solution
1. **Each half.** Each half produces $a_1x + a_2x^2 + \dots$ for inputs +x and −x.
2. **Subtract the outputs.** That doubles the odd terms and cancels the even ones:
   $$y(x) - y(-x) = 2a_1x + 2a_3x^3 + \dots$$
3. **What limits it.** Mismatch between the halves leaves a residue: with halves matched to 1%, HD2 falls by about 40 dB rather than vanishing.

**Answer:** subtracting the two halves cancels the even-order terms, and mismatch between the halves limits it: 1% matching cuts HD2 by only about 40 dB.
:::
:::

::: check
given: a = 0.05 | 0.2; A = 0.1 | 0.5 | 1
answer: 20*log(a*A/2)
unit: dB
tolerance: 0.5%

## A stage has $a_2/a_1$ = {a} V⁻¹ and is driven with amplitude {A} V. What's HD2, in dBc?

::: right
Right. $20\log\frac{a_2A}{2a_1}$ = {answer} dBc.
:::

::: misses
- [20*log(a*A)] The second harmonic gets half of the squared term.
- [any] Not yet. $\cos^2 = \frac{1 + \cos2\omega t}{2}$.
:::
:::

::: check
given: A = 2 | 5 | 20
answer: 20*log((A/1000)^2/(48*0.02585^2))
unit: dB
tolerance: 1%

## A bipolar differential pair is driven with a {A} mV sine. What's its HD3, in dBc?

::: right
Right. $\frac{A^2}{48V_T^2}$, or {answer} dBc.
:::

::: misses
- [20*log((A/1000)^2/(32*0.02585^2))] That's the MOS pair's coefficient with $V_T$; the tanh gives 1/48.
- [any] Not yet. Expand tanh to third order.
:::
:::

::: check
given: A = 10 | 50; v = 0.1 | 0.2 | 0.4
answer: 20*log((A/1000)^2/(32*v^2))
unit: dB
tolerance: 1%

## A MOS differential pair with $V_{ov}$ = {v} V is driven with {A} mV. What's its HD3, in dBc?

::: right
Right. $\frac{A^2}{32V_{ov}^2}$, or {answer} dBc.
:::

::: misses
- [any] Not yet. Expand the square-law pair to third order.
:::
:::

::: check
given: a = 1 | 10; c = 0.05 | 0.5 | 5
answer: sqrt(4/3*a/c)
unit: V
tolerance: 1%

## A stage has $a_1$ = {a} and $|a_3|$ = {c} V⁻². What's its input third-order intercept amplitude?

::: right
Right. $\sqrt{\frac{4}{3}\left|\frac{a_1}{a_3}\right|}$ = {answer} V.
:::

::: misses
- [sqrt(a/c)] Include the 4/3.
- [any] Not yet. Where IM3 would equal the fundamental.
:::
:::

::: check
given: c = 0.02 | 0.2; A = 0.05 | 0.2 | 0.5
answer: 20*log(3/4*c*A^2)
unit: dB
tolerance: 1%

## A stage with $a_1$ = 1 and $|a_3|$ = {c} V⁻² gets two tones of {A} V each. What's IM3, in dBc?

::: right
Right. $\frac{3}{4}|a_3|A^2$, or {answer} dBc.
:::

::: misses
- [20*log(c*A^2/4)] That's HD3; IM3 is three times larger.
- [any] Not yet. Expand $(A\cos\omega_1t + A\cos\omega_2t)^3$.
:::
:::

::: check
given: H = 40 | 60; T = 1 | 2 | 4
answer: -H - 20*log(1 + T)
unit: dB
tolerance: 1%

## An open-loop stage has −{H} dBc of HD3. It's closed inside a loop gain of {T}. Where does HD3 go?

::: right
Right. Divided by 1 + T: {answer} dBc.
:::

::: misses
- [-H - 20*log(T)] Divide by 1 + T.
- [any] Not yet. Feedback divides the error by the loop gain plus one.
:::
:::

::: check
given: d = 6 | 10 | 20
answer: 2*d
unit: dB
tolerance: 1%

## A stage's input rises {d} dB. By how many dB does its HD3 (relative to the fundamental) rise?

::: right
Right. HD3 ∝ $A^2$: {answer} dB.
:::

::: misses
- [3*d] That's the IM3 product's absolute level; relative to the fundamental it's 2 dB per dB.
- [d] That's HD2's slope.
- [any] Not yet. HD3 scales as $A^2$.
:::
:::

::: check
kind: parts
given: v = 5 | 10 | 20; T = 1 | 10 | 100

## A bipolar differential pair is driven with a {v} mV peak sine; its HD3 is about $\tfrac{1}{48}(v/V_T)^2$. It sits inside a loop of gain {T}.

::: part
answer: (v/25.85)^2/48*100
unit: %
tolerance: 0.5%

### What is its open-loop HD3?

::: misses
- [any] $(v/V_T)^2/48$.
:::
:::

::: part
answer: (v/25.85)^2/48*100/(1 + T)
unit: %
tolerance: 1%

### Roughly what does feedback reduce it to?

::: misses
- [any] Divide by $1 + T$.
:::
:::
:::

::: check
kind: derivation
vars: a = 0.1..10, b = 0.001..1, x = 0.001..0.5

## A stage's output is $a x + c x^3$ with $c = -b$, for input amplitude x.

::: step
answer: sqrt(4*a/(3*b))

### What is its input-referred third-order intercept (amplitude)?
:::

::: step
answer: 3*b*x^2/(4*a)

### What is IM3 relative to the fundamental, at x per tone?
:::

::: right
Right. IM3 grows as the square of the input, so every 1 dB of input raises it 2 dB relative to the signal.
:::
:::

::: explain
## Why is a MOS differential pair at high overdrive more linear than a bipolar pair at the same current?

::: model
Distortion comes from the curvature of the transfer law, and the size of the curvature is measured against a characteristic voltage. For a bipolar pair that voltage is $2V_T$, about 52 mV, fixed by physics, so a 10 mV input already reaches far enough along the tanh curve to bend it noticeably. For a MOS pair the characteristic voltage is the overdrive, which the designer chooses; at 200 mV, the same 10 mV input sees only a slight bend. Third-order distortion goes as the square of the input over that voltage, so a characteristic voltage four times larger gives sixteen times less HD3. The MOS pair pays for it with less transconductance per unit current.
:::
:::

::: practice

::: check
given: A = 2 | 3 | 5 | 8 | 10 | 15
answer: 20*log((A/1000)^2/(48*0.02585^2))
unit: dB
tolerance: 1%

## Bipolar pair HD3 at {A} mV?

::: misses
- [any] $A^2/48V_T^2$.
:::
:::

::: check
given: A = 20 | 80; v = 0.15 | 0.3
answer: 20*log((A/1000)^2/(32*v^2))
unit: dB
tolerance: 1%

## MOS pair HD3: {A} mV, $V_{ov}$ = {v} V?

::: misses
- [any] $A^2/32V_{ov}^2$.
:::
:::

::: check
given: a = 2 | 8; c = 0.1 | 1
answer: sqrt(4/3*a/c)
unit: V
tolerance: 1%

## IIP3 amplitude: $a_1$ = {a}, $|a_3|$ = {c}?

::: misses
- [any] $\sqrt{4a_1/3a_3}$.
:::
:::
:::
