5.5.4 · D5Embedded Systems & Real-Time Software

Question bank — ADC - DAC — resolution, sampling rate, Nyquist

1,818 words8 min readBack to topic

Before we start, every symbol this page reuses, defined in plain words:

  • resolution = how finely the amplitude (voltage height) is sliced → measured in bits ().
  • sampling rate = how often in time we grab a value → measured in Hz.
  • = the highest frequency component present in the signal — the fastest wiggle hiding inside whatever you feed the ADC. Nyquist is stated against this number.
  • = the converter's full-scale reference voltage — the top of the range it can read (e.g. 3.3 V). Any input from 0 up to maps to a code.
  • LSB (Least-Significant-Bit step) = the smallest voltage step the converter can distinguish, one rung of the ladder: .
  • = the quantization step size, which is just one LSB (the width of one rounding "bin") — used in the noise formula .
  • aliasing = a fast wave, under-sampled, disguising itself as a slow one.

True or false — justify

Sampling at exactly always lets you reconstruct the wave.
False. At exactly twice the frequency you can keep landing on the zero crossings and read , so amplitude and phase are lost. The criterion is strict: .
A 16-bit ADC will always give a cleaner recording than a 12-bit one.
False. More bits only improve amplitude precision. If your under-samples the signal, the extra bits faithfully record the wrong (aliased) waveform — cleaner garbage.
Doubling the number of bits doubles the SNR in dB.
False. The point is per-bit: adding one bit (which ×2 the number of levels) adds ~6 dB, from . So SNR grows linearly with the bit count . If you literally double from 8 to 16 you add eight bits → dB, not a factor of two. See Quantization Noise & SNR for the full derivation.
An anti-aliasing filter goes after the ADC.
False. It must sit before the ADC (in the analog domain). Once a frequency has aliased during sampling it is already tangled with real low-frequency content and cannot be untangled digitally — a low-pass filter blocks the high frequencies while they are still analog. See Anti-Aliasing Filters.
Nyquist guarantees reconstruction for any signal if is high enough.
False. It requires the signal be band-limited — no energy above . A signal with unbounded frequency content (e.g. a perfect square wave) has no finite and can never be sampled without aliasing.
The Nyquist frequency is a property of the signal.
False. It is a property of the sampler — it depends only on . The signal has an ; the sampler has an . Aliasing happens when the signal's exceeds the sampler's .
Quantization error is truly random noise.
Mostly false — it's a useful model. The error is deterministic (it depends on the input value), but for busy, large signals it behaves like uniform noise of width (one LSB), which is why works. For a slow DC input it is a fixed offset, not noise.
A DAC reproduces the exact voltage that entered the original ADC.
False. It reproduces , which is the quantized value — rounded to the nearest ladder rung. Everything finer than one LSB was thrown away and cannot return.
Using instead of is a mistake.
Half-true. It is an approximation: there are gaps between codes, so the exact step is . The form is common and its error is negligible for large — acceptable, not "exactly correct".

Spot the error

"To capture a 20 kHz tone I sample at 20 kHz."
Error: you need kHz (here kHz). Sampling at the signal frequency gives one point per cycle — a constant reading, no oscillation seen at all.
"My signal only has energy up to 5 kHz, so I don't need an anti-alias filter at kHz."
Error: noise and interference (RF pickup, EMI, thermal) live above 5 kHz too. Without a filter, that out-of-band junk aliases down into your 0–6 kHz band. Band-limiting must be enforced, not assumed.
"CD audio uses 44.1 kHz because humans hear up to 44.1 kHz."
Error: humans hear to ~20 kHz, so kHz, needing kHz. The extra 4.1 kHz is filter margin — room for the real anti-alias filter's gradual roll-off, since no filter is a perfect brick wall.
"The reconstruction filter's job is to add back the bits we lost."
Error: it removes the staircase's high-frequency images (from the zero-order hold — the flat steps in the figure above), smoothing steps into a curve. It cannot restore quantization detail — that information is gone at the ADC. See Zero-Order Hold & Reconstruction.
"Increasing improves resolution."
Error: raising widens the full-scale span while keeping codes, so each LSB step gets bigger — resolution gets worse. Lowering (to match your signal's true range) shrinks the step.
"Aliasing adds a new high frequency to my recording."
Error: aliasing folds high frequencies down to a lower apparent frequency below . A 1800 Hz tone at Hz appears as 200 Hz — a fake low tone, not a new high one.

Why questions

Why exactly two samples per period, not three or four?
Two points (one per hump) are the theoretical minimum to fix a sinusoid's frequency and amplitude. Fewer leaves an oscillation ambiguous; two is the mathematical floor Nyquist proves is sufficient (in the strict sense).
Why does sampling make frequencies and indistinguishable?
Sampled values are ; adding inside gives , and cosine is -periodic so the extra term vanishes. Identical samples ⇒ the sampler literally cannot tell them apart. See Fourier Transform & Frequency Domain.
Why is the quantization variance and not, say, ?
Because is the variance denominator of a uniform distribution: for a flat spread over width (one LSB), variance . It reflects the spread of the rounding error, not its maximum ().
Why does each extra bit add ~6 dB of SNR, not some other number?
An extra bit halves the step , so noise power drops to one quarter. In decibels a quarter-power is dB — the constant in .
Why can't a purely digital algorithm remove aliasing after sampling?
Once folded, the aliased frequency occupies the same bin as legitimate low-frequency signal — they are algebraically summed and indistinguishable. No digital operation can separate a sum back into unknown parts.
Why does the DAC produce a staircase rather than a smooth curve on its own?
A basic DAC holds each code's voltage constant until the next sample arrives — zero-order hold (the amber staircase in the figure). Holding a level for makes flat steps, whose sharp edges are exactly the high-frequency images the smoothing filter must erase.
Why does a filter with only "cut-off ≈ " leave margin for design?
Real filters roll off gradually, not instantly. Placing the highest signal well below (as CD does) gives the transition band physical room, so unwanted energy is genuinely attenuated by the Nyquist point. See Anti-Aliasing Filters.

Edge cases

What happens if a frequency sits exactly at ?
You get two samples per cycle, but if they land on the zero crossings the reconstructed amplitude reads zero — the boundary is unreliable, which is why the criterion excludes equality.
What does the ADC output for an input below 0 V or above ?
It saturates (clips) to the lowest code (0) or the highest code (). Everything out of range collapses to the rail — a hard, non-recoverable distortion, unlike quantization.
What is the alias of a DC signal (0 Hz)?
DC never aliases — it is already below every , and trivially satisfies . It samples to a constant, exactly as intended.
For a perfectly noiseless, constant DC input, what is the "quantization noise"?
It's a fixed offset, not noise — the input rounds to one nearest code every time. The noise model breaks down because there's no variation to average out.
What if (a signal with no time variation)?
Any satisfies Nyquist since always holds. A truly static signal can be sampled arbitrarily slowly with no aliasing.
If is extremely high (massive over-sampling), is resolution automatically better?
No — resolution is set by bits, independent of . But over-sampling can be traded for effective bits by averaging (the principle behind sigma-delta converters). See Successive Approximation vs Sigma-Delta ADC.

Connections

  • ADC - DAC — resolution, sampling rate, Nyquist (index 5.5.4)
  • Quantization Noise & SNR
  • Anti-Aliasing Filters
  • Zero-Order Hold & Reconstruction
  • Fourier Transform & Frequency Domain
  • Successive Approximation vs Sigma-Delta ADC