---
title: Signal swing and distortion
heading: How large a signal can get before the transistor's curve shows
eyebrow: C5 · Lesson 46 · Signal swing and distortion
xp: 40
---

::: hook
Small-signal models assume small signals. Feed a real stage a larger one and the transistor's curve shows through: the exponential (or the square law) stretches one half of the wave and squashes the other, adding harmonics that weren't in the input. For audio that's audible distortion; for a radio it's interference created out of nothing. This lesson puts numbers on it: how much distortion a given signal causes, and how degeneration buys it back.

::: play
- The trace is a bipolar transistor's collector current, relative to its bias current, when its base gets a sine of peak $x V_T$. The bars are its spectrum.
- At small x the current is a clean sine with one bar. Raise x: the positive peaks stretch, the negative ones flatten, and a second bar appears at twice the frequency, then a third.
- The second harmonic grows in proportion to x, the third as x². Compare the bars with the estimates below.
:::
:::

```sim plot
view: spectrum
x: t = 0..5m s
y: i = -1..8
samples: 1024
freq: f = 0..5k Hz
slider: x = 0.05..2 step 0.05 = 0.4
plot: exp(x*cos(2*pi*1000*t)) - 1 | label: collector current change, relative
readout: second harmonic estimate, % = x/4*100 | digits: 3
readout: third harmonic estimate, % = x^2/24*100 | digits: 3
```

::: predict
## A bipolar transistor at 1 mA, with no emitter resistor, gets a 10 mV peak sine at its base. About how much second harmonic is in its collector current, relative to the fundamental?

- [ ] About 0.1%
- [ ] About 1%
- [x] About 10%
- [ ] About 50%

::: reveal
About 10%: $\frac{\hat v}{4V_T} = \frac{10}{4 \times 25.85}$ = 9.7%. Ten millivolts sounds small, but the exponential changes its slope by a factor of e every 26 mV, so a 10 mV swing already bends the wave visibly. That's why gain stages are degenerated, or run with feedback.
:::
:::

::: nameit
## Harmonic distortion

A nonlinear stage turns a pure sine into the sine plus harmonics. The **n-th harmonic distortion** $HD_n$ is the n-th harmonic's amplitude over the fundamental's, and the **total harmonic distortion** is

$$\text{THD} = \sqrt{HD_2^2 + HD_3^2 + \cdots},$$

often quoted in percent or in decibels, $20\log\text{THD}$.

## The bipolar transistor

Expanding $i_C = I_Ce^{v/V_T}$ for $v = \hat v\cos\omega t$:

$$HD_2 \approx \frac{\hat v}{4V_T}, \qquad HD_3 \approx \frac{\hat v^2}{24V_T^2}.$$

The squared term also has an average: the bias current rises by about $\frac{\hat v^2}{4V_T^2}$ of itself, the same rectification that makes a diode detector work.

## The MOSFET

The square law, $i_D = \frac K2(v_{OV} + v)^2$, has only a squared term, so

$$HD_2 = \frac{\hat v}{4v_{OV}}, \qquad HD_3 = 0$$

for an ideal square-law device. A larger overdrive means a more linear stage, at the price of less transconductance per milliamp.

## Degeneration

With an emitter resistor, the junction sees only $\frac{\hat v_\text{in}}{1 + g_mR_E}$ of the input, and the feedback suppresses the harmonic it does create by the same factor again:

$$HD_2 \approx \frac{\hat v_\text{in}}{4V_T(1 + g_mR_E)^2}.$$

For the same output amplitude, degeneration divides the distortion by $1 + g_mR_E$, the loop gain. This is the first example of the rule that feedback trades gain for linearity.

## Clean output per volt of bias

For a stage with load resistance R, the output at a given $HD_2$ depends only on the DC drop across R: an undegenerated BJT gives $\hat v_o = 4HD_2 \times I_CR$, and a MOSFET twice that, $8HD_2 \times I_DR$. Differential pairs cancel the even harmonics altogether (C6), and hard clipping, when the transistor saturates or cuts off, sets the final limit.
:::

::: example
## A common-emitter stage at 1 mA with $R_C$ = 4.7 kΩ and its emitter bypassed (gain −182) must keep $HD_2$ below 1%. How large can its input and output be?

::: solution
1. **Input limit.** $HD_2 = \frac{\hat v}{4V_T}$ = 0.01 gives
   $$\begin{aligned} \hat v &= 0.04 \times 25.85\ \text{mV} \\ &= 1.03\ \text{mV} \end{aligned}$$
2. **Output limit.** With a gain of −182, that's 0.19 V at the output.
3. **What it means.** The stage could swing several volts before clipping, but only a fifth of a volt of it is clean to 1%. The ceiling is $4HD_2 \times I_CR_C$ = 0.04 × 4.7 V.

**Answer:** the input can be 1.03 mV peak and the output 0.19 V peak.
:::
:::

::: example
## The same stage gets an unbypassed $R_E$ = 470 Ω. How large can the input and output be now for 1% $HD_2$?

::: solution
1. **Loop gain.**
   $$\begin{aligned} g_mR_E &= 38.7\ \text{mS} \times 470\ \Omega \\ &= 18.2 \end{aligned}$$
   so the loop gain is 19.2.
2. **Input limit.**
   $$\begin{aligned} \hat v_\text{in} &= 0.04 \times 25.85\ \text{mV} \\ &\quad \times 19.2^2 \\ &= 380\ \text{mV} \end{aligned}$$
3. **Output limit.** The gain is now
   $$-\frac{4700}{25.6 + 470} = -9.5$$
   so the output is 3.6 V peak.
4. **The trade.** Degeneration cut the gain by 19 and raised the clean output by 19.
5. **A caution.** The formula comes from a small-signal expansion, though, and at a swing this large it's optimistic: solving the stage exactly, as lesson 47's lab does, gives 1.4% at 380 mV. Treat it as a lower bound once the junction's own swing nears $V_T$.

**Answer:** the input can now be 380 mV peak and the output 3.6 V peak, though the exact distortion at that size is 1.4%.
:::
:::

::: example
## Compare a MOSFET stage at 1 mA with 0.25 V of overdrive and the same 4.7 kΩ load: what output does it reach at 1% $HD_2$?

::: solution
1. **Input limit.** $HD_2 = \frac{\hat v}{4v_{OV}}$ = 0.01 needs $\hat v$ = 10 mV.
2. **Gain.**
   $$\begin{aligned} A_v &= -\frac{2I_D}{v_{OV}}R_D \\ &= -37.6 \end{aligned}$$
3. **Output.** That makes 0.38 V, twice the bipolar stage's 0.19 V.
4. **Compare.** The MOSFET has five times less gain but ten times more input range. For a fixed bias current and load, the square law's clean output is twice the exponential's, whatever the overdrive.

**Answer:** the MOSFET stage reaches 0.38 V peak at 1% $HD_2$, twice the bipolar stage's 0.19 V.
:::
:::

::: check
given: v = 1 | 2 | 5 | 10; I = 0.5 | 1
answer: v/(4*25.85)*100
unit: %
tolerance: 0.5%

## A bipolar transistor at {I} mA, undegenerated, gets a {v} mV peak at its base. What's the second-harmonic distortion of its collector current?

::: right
Right. $HD_2 = \frac{\hat v}{4V_T}$ = {answer}, whatever the bias current.
:::

::: misses
- [v/25.85*100] Divide by four: the squared term gives $\frac{x^2}{4}$ at twice the frequency.
- [any] $HD_2 \approx \frac{\hat v}{4V_T}$.
:::
:::

::: check
given: v = 5 | 20 | 50; ov = 0.15 | 0.3 | 0.6
answer: v/(4*ov*1000)*100
unit: %
tolerance: 0.5%

## A square-law MOSFET with {ov} V of overdrive gets a {v} mV peak at its gate. What's its second-harmonic distortion?

::: right
Right. $HD_2 = \frac{\hat v}{4v_{OV}}$ = {answer}.
:::

::: misses
- [v/(4*25.85)*100] For a MOSFET, the overdrive replaces $V_T$.
- [any] $HD_2 = \frac{\hat v}{4v_{OV}}$.
:::
:::

::: check
kind: parts
given: I = 0.5 | 1 | 2; RE = 0.1 | 0.47 | 1; v = 50 | 200

## A bipolar stage at {I} mA has {RE} kΩ of unbypassed emitter resistance and a {v} mV peak input.

::: part
answer: 1 + I/0.02585*RE
tolerance: 0.5%

### What's its loop gain, $1 + g_mR_E$?

::: misses
- [I/0.02585*RE] Add 1.
- [any] $1 + \frac{I_C}{V_T}R_E$.
:::
:::

::: part
answer: v/(4*25.85*(1 + I/0.02585*RE)^2)*100
unit: %
tolerance: 1%

### What's its second-harmonic distortion?

::: misses
- [v/(4*25.85*(1 + I/0.02585*RE))*100] The loop gain enters squared for a fixed input.
- [v/(4*25.85)*100] Degeneration shrinks the junction's share of the signal.
- [any] $HD_2 \approx \frac{\hat v_\text{in}}{4V_T(1 + g_mR_E)^2}$.
:::
:::
:::

::: check
given: h = 0.1 | 0.5 | 1 | 3
answer: 4*h/100*25.85
unit: mV
tolerance: 0.5%

## What's the largest peak input an undegenerated bipolar stage can take while keeping its second harmonic at {h}%?

::: right
Right. $\hat v = 4V_T \times HD_2$ = {answer}.
:::

::: misses
- [h/100*25.85] $HD_2 = \frac{\hat v}{4V_T}$, so $\hat v = 4V_T \times HD_2$.
- [any] Solve $\frac{\hat v}{4V_T} = HD_2$.
:::
:::

::: check
kind: parts
given: a = 1 | 3 | 5; b = 0.2 | 0.5 | 2

## An amplifier's output has {a}% second harmonic and {b}% third harmonic.

::: part
answer: sqrt(a^2 + b^2)
unit: %
tolerance: 0.5%

### What's its total harmonic distortion?

::: misses
- [a + b] Harmonics add in power, so their amplitudes add in quadrature.
- [any] $\sqrt{HD_2^2 + HD_3^2}$.
:::
:::

::: part
answer: 20*log(sqrt(a^2 + b^2)/100)
unit: dB
tolerance: 0.5%

### What's that in decibels?

::: misses
- [10*log(sqrt(a^2 + b^2)/100)] Distortion is an amplitude ratio: use $20\log$.
- [any] $20\log\text{THD}$.
:::
:::
:::

::: check
kind: parts
given: I = 0.5 | 1 | 2; R = 2.2 | 4.7 | 10; h = 0.5 | 1

## A stage at {I} mA drives a {R} kΩ load and must keep $HD_2$ at {h}%.

::: part
answer: 4*h/100*I*R
unit: V
tolerance: 0.5%

### What peak output can an undegenerated bipolar stage give?

::: misses
- [any] $4HD_2 \times I_CR$.
:::
:::

::: part
answer: 8*h/100*I*R
unit: V
tolerance: 0.5%

### And a square-law MOSFET stage?

::: misses
- [4*h/100*I*R] The MOSFET's clean output is twice the bipolar's.
- [any] $8HD_2 \times I_DR$.
:::
:::
:::

::: check
kind: derivation
vars: I = 0.00001..0.01, x = 0.01..0.3, T = 0.02..0.03

## A bipolar transistor at current I and thermal voltage T gets an input $v = xT\cos\omega t$. Expand $e^{x\cos\omega t}$ to second order.

::: step
answer: I*x

### What's the fundamental's amplitude in the collector current?
:::

::: step
answer: I*x^2/4

### What's the second harmonic's amplitude? (Use $\cos^2\theta = \frac{1 + \cos2\theta}{2}$.)
:::

::: step
answer: x/4

### What's their ratio, $HD_2$?
:::

::: step
answer: I*x^2/4

### By how much does the average current rise?
:::

::: right
Right. The squared term splits equally between a DC shift and the second harmonic.
:::
:::

::: explain
## Why does an emitter resistor reduce a stage's distortion?

::: model
The distortion comes from the transistor's exponential curve, and how much depends on how large a signal appears across the base-emitter junction. With an emitter resistor, most of the input appears across the resistor instead, because the resistor's voltage follows the collector current: the junction sees only the input divided by one plus $g_mR_E$. A smaller swing on the junction means a much smaller bend. And the harmonic current the junction does create flows through the resistor too, which feeds it back and suppresses it again. The stage gives less gain, but the gain it gives is set mostly by a linear resistor.
:::
:::

::: practice

::: check
given: v = 0.5 | 4; I = 1 | 3
answer: v/(4*25.85)*100
unit: %
tolerance: 0.5%

## {v} mV peak into an undegenerated BJT. $HD_2$?

::: misses
- [any] $\frac{\hat v}{4V_T}$.
:::
:::

::: check
given: v = 10 | 80; ov = 0.2 | 0.5
answer: v/(4*ov*1000)*100
unit: %
tolerance: 0.5%

## {v} mV peak, {ov} V overdrive. MOSFET $HD_2$?

::: misses
- [any] $\frac{\hat v}{4v_{OV}}$.
:::
:::

::: check
given: a = 0.4 | 2; b = 0.1 | 0.8
answer: sqrt(a^2 + b^2)
unit: %
tolerance: 0.5%

## $HD_2$ = {a}%, $HD_3$ = {b}%. THD?

::: misses
- [any] $\sqrt{HD_2^2 + HD_3^2}$.
:::
:::
:::
