S7 · Lesson 8 · Oversampling and noise shaping
Spreading quantization noise by oversampling, pushing it out of band with feedback, the SNR of shaped converters, and decimating back to the signal rate
A one-bit converter, a comparator, is about the crudest quantizer imaginable, yet the converters in nearly every phone and audio interface are built around one. The trick is to sample far faster than the Nyquist rate and use feedback so the quantization error is mostly at high frequencies, where a digital filter can then remove it. S2 built the analog loop; this lesson does the signal-processing accounting: how much of the noise lands in the band of interest, how that depends on the oversampling ratio and the shaping order, and why each doubling of the clock buys more than six decibels once the noise is shaped.
- The quantization noise spectrum after shaping of order p, in dB, against frequency from 0 to π (the oversampled Nyquist frequency), with the signal band ending at π/M.
- With p = 0 the noise is flat; plain oversampling only spreads it thinner. With shaping the noise is driven down near zero frequency and up near π.
- The readout gives the in-band noise relative to unshaped, unoversampled quantization: in dB.
Predict
A converter is oversampled by 64. How much does its in-band SNR improve with no noise shaping, and with first-order shaping?
Plain oversampling spreads the same noise power over 64 times the bandwidth, so the in-band fraction falls by 10 log 64 = 18.1 dB. First-order shaping also lowers the noise density near DC, and the in-band noise falls by = 54.2 − 5.2 = 49.0 dB. Every doubling of M then gains 9 dB with first-order shaping, against 3 dB without.
Name it
Oversampling alone
Quantization noise of power is spread evenly from 0 to π. Sampling M times faster than needed and lowpass-filtering to π/M keeps only 1/M of it:
3 dB, half a bit, per doubling of M.
Noise shaping
Feeding the quantization error back through a filter gives an output : the signal passes unchanged while the noise is filtered by the noise transfer function , whose magnitude is small near ω = 0. The in-band noise power is
so the SNR becomes
- first order: , 9 dB per octave of oversampling;
- second order: , 15 dB per octave.
Orders above two need careful loop design to stay stable with a coarse quantizer.
Decimation
The shaped noise above π/M must be removed before the rate is reduced: a cascade of decimating filters (often a CIC stage, then FIR halfband stages) lowers the rate by M while keeping only the band of interest. The output then carries the high-resolution samples at the signal rate. The effective number of bits is .
Worked example
A 1-bit quantizer runs at 64 times oversampling. What SNR does it give with no shaping, first-order and second-order shaping?
Show the solution
- No shaping.
- First order.
- Second order. That's equivalent to 13.9 bits from a one-bit quantizer.
Answer 25.8 dB with no shaping, 56.8 dB with first-order shaping and 85.2 dB with second-order shaping.
Worked example
The first-order design needs 65 dB. How much faster must it run?
Show the solution
- Gain per doubling. Each doubling of the oversampling ratio gains 9.03 dB with first-order shaping.
- Try M = 128. That's enough.
- Compare second order. The second-order design would need only M = 64, which is why second-order and higher loops are the norm.
Answer twice as fast, M = 128, which gives 65.8 dB.
Worked example
A 16-bit audio DAC runs at 4× oversampling with second-order noise shaping. What in-band SNR can it reach? What would a 1-bit, third-order modulator at 64× reach?
Show the solution
- 16 bits, 4×, second order. against 98.1 dB without oversampling.
- One bit, 64×, third order.
- Compare. The one-bit design matches the 16-bit one by trading word length for speed, but a third-order loop with a one-bit quantizer needs careful design to stay stable.
Answer the 16-bit DAC reaches 115.3 dB, and the 1-bit third-order modulator at 64× reaches 112.8 dB.
Check
A 4-bit quantizer is oversampled by 8 with no noise shaping. What's the in-band SNR?
Check
The same quantizer (2 bits, oversampled ×16) is put in a first-order noise-shaping loop. What's the in-band SNR?
Check
With second-order shaping instead, what's the in-band SNR?
Check
By how much does each doubling of the oversampling ratio improve the SNR with order-1 noise shaping?
Check
A converter achieves 85 dB SNR. What's its effective number of bits?
Check
By how much does order-1 shaping change the noise density at ω = 0.01 rad?
Check
A 4-bit quantizer is oversampled by 4 with order-3 noise shaping.
(a)
What in-band SNR does it give?
(b)
How many effective bits is that?
Check
A B-bit quantizer is oversampled by M with order-p shaping.
Step 1
What is the SNR with oversampling alone?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is it with the shaping?
Step 3
How many decibels does each doubling of M add with shaping?
Explain why
How can a one-bit quantizer produce a 14-bit-accurate signal?
A one-bit quantizer's error is huge on every sample, but the error is only a problem if it lands in the frequency band that's kept. Running the converter many times faster than the signal needs spreads the error over a much wider band, and wrapping the quantizer in a feedback loop that integrates the error shapes it further: the loop keeps the running average of the output close to the input, so the error is pushed toward high frequencies, where it changes rapidly from sample to sample. A digital lowpass filter then removes nearly all of that high-frequency error and lowers the sample rate, and the averaged output carries many more bits of accuracy than any single sample did. The resolution comes from time and averaging rather than from fine voltage steps.
Practice
Keep practicing
10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.