---
title: Delta-sigma modulators
heading: Oversampling and noise shaping, trading speed for resolution
eyebrow: S2 · Lesson 43 · Delta-sigma modulators
xp: 50
---

::: hook
Your phone's audio codec gets 16 to 24 bits of resolution out of a quantizer with one bit. It does it by sampling far faster than the signal needs and putting the quantizer inside a feedback loop that pushes the quantization noise out of the signal band to high frequencies, where a digital filter throws it away. That's a delta-sigma modulator. Its resolution depends on the oversampling ratio and the order of the loop's filter, not on component matching, which is why it dominates audio, sensors and precision measurement, everywhere bandwidth is modest and resolution matters.
:::

::: play
- The noise transfer function of delta-sigma modulators of order 1, 2 and 3, in dB, against frequency as a fraction of the sampling rate (log scale). Quantization noise is multiplied by this shape.
- At low frequencies the noise is pushed down steeply, 20 dB per decade per order; at half the sample rate it's amplified.
- The marker is the signal band's edge for the chosen oversampling ratio. The readouts give the ideal SQNR of a one-bit modulator of each order there.
:::
:::

```sim plot
view: graph
x: f = 0.0001..0.5 log
y: N = -140..20
slider: OSR = 8..512 = 64 log
plot: 20*log(2*sin(pi*f)) | samples: 400 | label: first order
plot: 40*log(2*sin(pi*f)) | samples: 400 | color: ch2 | label: second order
plot: 60*log(2*sin(pi*f)) | samples: 400 | color: ch3 | label: third order
marker: x = 1/(2*OSR) | label: band edge
readout: SQNR, first order, dB = 6.02 + 1.76 - 5.17 + 30*log(OSR)
readout: SQNR, second order, dB = 6.02 + 1.76 - 12.9 + 50*log(OSR)
readout: SQNR, third order, dB = 6.02 + 1.76 - 21.38 + 70*log(OSR)
```

::: predict
## Plain oversampling (no noise shaping) improves SQNR by 3 dB every time the sample rate doubles. How much does doubling the sample rate gain a second-order delta-sigma modulator?

- [ ] 3 dB
- [ ] 6 dB
- [x] 15 dB
- [ ] 30 dB

::: reveal
15 dB, two and a half bits. An L-th order modulator's in-band noise falls as $\text{OSR}^{2L + 1}$, so each doubling gains $(2L + 1) \times 3$ dB: 9 dB for first order, 15 dB for second, 21 dB for third. That's why practical designs use second to fifth order loops with oversampling ratios of 32 to 256.
:::
:::

::: nameit
## Oversampling

A quantizer's noise, $\Delta^2/12$, spreads evenly from 0 to $f_s/2$. With a signal band of only $f_B$, the **oversampling ratio** $\text{OSR} = \frac{f_s}{2f_B}$ leaves only 1/OSR of it in band: 10 log OSR dB better, 3 dB (half a bit) per doubling.

## Noise shaping

Put the quantizer inside a loop with an integrator: the output is $Y(z) = z^{-1}X(z) + (1 - z^{-1})E(z)$. The signal passes unchanged; the quantization error E is filtered by the **noise transfer function**

$$|NTF(f)| = \left|2\sin\frac{\pi f}{f_s}\right|^L$$

for an L-th order loop: tiny at low frequency, large near $f_s/2$.

## Resolution

Integrating the shaped noise over the band gives, for an N-bit quantizer,

$$\text{SQNR} = 6.02N + 1.76 - 10\log\frac{\pi^{2L}}{2L + 1} + (2L + 1)\cdot10\log\text{OSR}$$

The penalty term is 5.2 dB for L = 1, 12.9 dB for L = 2, 21.4 dB for L = 3.

## In practice

- **One-bit quantizers** are perfectly linear (two levels always make a straight line), which is why delta-sigma DACs and ADCs reach very low distortion without trimming.
- **Stability:** single-bit loops above second order can overload with large inputs, so their input range is restricted, or multibit quantizers are used.
- **Decimation:** a digital low-pass filter removes the shaped noise and reduces the sample rate to the Nyquist rate.
- **Circuit limits:** the first integrator's noise, thermal kT/C noise and clock jitter (for continuous-time loops) often set the real floor below the ideal SQNR.
:::

::: example
## A one-bit, second-order modulator runs at an oversampling ratio of 64. What's its ideal SQNR and effective resolution?

::: solution
1. **SQNR.**
   $$\begin{aligned} \text{SQNR} &= 6.02 + 1.76 - 12.9 \\ &\quad + 5 \times 10\log 64 \\ &= 7.78 - 12.9 + 90.3 \\ &= 85.2\ \text{dB} \end{aligned}$$
2. **Effective resolution.**
   $$\begin{aligned} \text{ENOB} &= \frac{85.2 - 1.76}{6.02} \\ &= 13.9\ \text{bits} \end{aligned}$$
   from a one-bit quantizer.
3. **Clock for audio.** At 48 kHz:
   $$64 \times 48\ \text{kHz} = 3.07\ \text{MHz}$$
4. **Third order.** At the same OSR it adds 20 log 64 = 36 dB of shaping and 8.5 dB more penalty, for about 113 dB.

**Answer:** an ideal SQNR of 85.2 dB, or 13.9 bits.
:::
:::

::: example
## How much oversampling alone, with no noise shaping, does it take to gain 4 bits? And what does a first-order loop give at OSR = 128?

::: solution
1. **Bits to decibels.** 4 bits is 24 dB.
2. **Plain oversampling.**
   $$\text{OSR} = 10^{2.4} \approx 251$$
   (256, since each 4× gives 6 dB).
3. **First-order loop at 128.**
   $$\begin{aligned} \text{SQNR} &= 7.78 - 5.17 + 30\log 128 \\ &= 65.8\ \text{dB} \end{aligned}$$
   about 10.6 bits.
4. **What shaping buys.** Noise shaping is what makes oversampling worth the clock speed.

**Answer:** about 251 times oversampling without shaping (256, counting 6 dB per factor of 4); a first-order loop at OSR = 128 gives 65.8 dB, about 10.6 bits.
:::
:::

::: example
## What SQNR does a one-bit, first-order modulator reach at an oversampling ratio of 128?

::: solution
1. **SQNR.**
   $$\begin{aligned} \text{SQNR} &= 6.02 + 1.76 - 5.17 \\ &\quad + 30\log_{10}128 \\ &= 65.8\ \text{dB} \end{aligned}$$
   about 10.6 bits.
2. **Per doubling.** Each doubling of OSR adds 9 dB, against 15 dB for second order.
3. **Idle tones.** First-order loops also produce idle tones on DC inputs, so second order is the usual minimum.

**Answer:** 65.8 dB, about 10.6 bits.
:::
:::

::: check
given: B = 20 | 100 | 1000; s = 3 | 10 | 50
answer: s*1e6/(2*B*1e3)
tolerance: 0.1%

## A converter samples at {s} MHz for a {B} kHz signal band. What's its oversampling ratio?

::: right
Right. $\text{OSR} = \frac{f_s}{2f_B}$ = {answer}.
:::

::: misses
- [s*1e6/(B*1e3)] The Nyquist rate is $2f_B$.
- [any] Not yet. Sample rate over the Nyquist rate.
:::
:::

::: check
given: O = 4 | 16 | 256
answer: 10*log(O)
unit: dB
tolerance: 0.5%

## Oversampling by {O} without noise shaping improves SQNR by how much?

::: right
Right. 10 log OSR = {answer} dB.
:::

::: misses
- [20*log(O)] Noise power falls as 1/OSR: 10 log.
- [any] Not yet. Only 1/OSR of the noise stays in band.
:::
:::

::: check
given: L = 1 | 2 | 3; O = 16 | 64 | 256
answer: 6.02 + 1.76 - 10*log(pi^(2*L)/(2*L + 1)) + (2*L + 1)*10*log(O)
unit: dB
tolerance: 0.5%

## A one-bit delta-sigma modulator of order {L} runs at OSR = {O}. What's its ideal SQNR?

::: right
Right. {answer} dB.
:::

::: misses
- [6.02 + 1.76 + (2*L + 1)*10*log(O)] Subtract the penalty $10\log\frac{\pi^{2L}}{2L + 1}$.
- [any] Not yet. Use the SQNR formula with N = 1.
:::
:::

::: check
given: L = 1 | 2 | 4
answer: (2*L + 1)*3.01
unit: dB
tolerance: 1%

## How much does doubling the oversampling ratio improve an order-{L} modulator's SQNR?

::: right
Right. $(2L + 1) \times 3$ dB = {answer} dB.
:::

::: misses
- [3.01] That's plain oversampling; noise shaping steepens the gain.
- [any] Not yet. In-band noise falls as $\text{OSR}^{2L + 1}$.
:::
:::

::: check
given: L = 1 | 2 | 3; f = 0.001 | 0.01
answer: 20*L*log(2*sin(pi*f))
unit: dB
tolerance: 1%

## What's an order-{L} noise transfer function's gain at {f} of the sample rate?

::: right
Right. $20L\log\left(2\sin\frac{\pi f}{f_s}\right)$ = {answer} dB.
:::

::: misses
- [any] Not yet. $|1 - e^{-j\omega}|^L$.
:::
:::

::: check
given: S = 70 | 90 | 110
answer: (S - 1.76)/6.02
tolerance: 0.5%

## A delta-sigma converter measures {S} dB of SNDR. What's its ENOB?

::: right
Right. {answer} bits.
:::

::: misses
- [S/6.02] Subtract 1.76 dB first.
- [any] Not yet. $(\text{SNDR} - 1.76)/6.02$.
:::
:::

::: check
kind: parts
given: L = 1 | 2 | 3; M = 32 | 64 | 128

## A one-bit delta-sigma modulator of order {L} runs at oversampling ratio {M}. Its ideal SQNR is $6.02 + 1.76 - 10\log_{10}\frac{\pi^{2L}}{2L + 1} + (2L + 1)10\log_{10}M$.

::: part
answer: 6.02 + 1.76 - 10*log(pi^(2*L)/(2*L + 1)) + (2*L + 1)*10*log(M)
unit: dB
tolerance: 0.5%

### What SQNR does it reach?

::: misses
- [any] Put L and M into the formula.
:::
:::

::: part
answer: (2*L + 1)*3.01
unit: dB
tolerance: 0.5%

### How much does each doubling of M add?

::: misses
- [any] $(2L + 1) \times 3$ dB.
:::
:::
:::

::: check
kind: derivation
vars: N = 1..16, M = 2..1024

## A Nyquist-rate N-bit quantizer is oversampled by M with no noise shaping.

::: step
answer: 6.02*N + 1.76 + 10*log(M)

### What SQNR does filtering to the signal band give?
:::

::: step
answer: 0.5*log(M)/log(2)

### How many bits does the oversampling add?
:::

::: right
Right. Plain oversampling gains only half a bit per doubling; noise shaping is what makes delta-sigma converters practical.
:::
:::

::: explain
## How does a feedback loop around a one-bit quantizer push its noise out of the signal band?

::: model
The loop's integrator accumulates the difference between the input and the quantized output. Whenever the output has been too high on average, the integrator's value falls and the quantizer starts choosing the lower level more often, and the reverse. So over any stretch of many samples, the average of the one-bit output tracks the input very closely: the low-frequency content of the error is driven toward zero. The error doesn't vanish, it just changes character: the loop makes it alternate rapidly, which puts its energy at high frequencies. A digital low-pass filter after the modulator averages the bitstream, keeping the accurate low-frequency signal and discarding the high-frequency noise.
:::
:::

::: practice

::: check
given: B = 24 | 500; s = 6.144 | 64
answer: s*1e6/(2*B*1e3)
tolerance: 0.1%

## OSR: {s} MHz for a {B} kHz band?

::: misses
- [any] $f_s/2f_B$.
:::
:::

::: check
given: L = 2 | 3; O = 32 | 128
answer: 6.02 + 1.76 - 10*log(pi^(2*L)/(2*L + 1)) + (2*L + 1)*10*log(O)
unit: dB
tolerance: 0.5%

## SQNR: order {L}, OSR {O}, one bit?

::: misses
- [any] The SQNR formula.
:::
:::

::: check
given: L = 1 | 2 | 3 | 4 | 5
answer: (2*L + 1)*3.01
unit: dB
tolerance: 1%

## Gain per doubling of OSR, order {L}?

::: misses
- [any] $(2L + 1) \times 3$ dB.
:::
:::
:::
