5.5.4 · D4Embedded Systems & Real-Time Software

Exercises — ADC - DAC — resolution, sampling rate, Nyquist

2,336 words11 min readBack to topic

A quick symbol reminder so no line surprises you:

Recall The five symbols every problem below uses
  • ::: number of bits — how many yes/no switches the converter has.
  • ::: total number of distinct output codes (levels).
  • ::: full-scale voltage span, e.g. to V.
  • ::: the smallest voltage step (one "rung" of the amplitude ladder).
  • ::: sampling rate in Hz; is the Nyquist frequency (the highest honest frequency).

L1 — Recognition

Problem 1.1

An ADC has bits. How many distinct output codes can it produce?

Recall Solution

WHAT: each bit is one on/off switch. WHY : independent switches count up to , which is different values.

Problem 1.2

Which quantity fixes amplitude precision and which fixes time precision: resolution or sampling rate?

Recall Solution
  • Resolution ( bits) → amplitude precision (how finely we slice voltage).
  • Sampling rate () → time precision (how often we measure). They are independent knobs. One does not help the other.

Problem 1.3

State the Nyquist criterion for perfectly reconstructing a signal whose highest frequency is .

Recall Solution

The inequality is strict (a bare , not ). The boundary is the Nyquist frequency .


L2 — Application

Problem 2.1

A 12-bit ADC has V. Find the LSB step size in millivolts.

Recall Solution

WHAT: the smallest voltage the ADC can distinguish. WHY : the span is divided by the number of gaps. Any input change smaller than mV lands in the same code and is invisible.

Problem 2.2

Same 12-bit, V ADC. What code does an input of V produce?

Recall Solution

WHY round: the ADC snaps to the nearest level (mid-tread quantizer).

Problem 2.3

A tone at Hz is sampled at Hz. Is it aliased? If not, why not?

Recall Solution

Nyquist frequency Hz. Since , the tone is above Nyquist, so it aliases. The 1.8 kHz tone masquerades as a fake 700 Hz tone.

Problem 2.4

What is the ideal maximum SNR of a 16-bit ADC in dB?

Recall Solution

WHY this formula: each extra bit halves the quantization step, and halving noise amplitude adds dB.


L3 — Analysis

Problem 3.1

A signal contains two tones: Hz and Hz. You sample at Hz with no anti-aliasing filter. After sampling, what two frequencies appear below Nyquist, and can you separate them?

Recall Solution

Hz.

  • Hz is below Nyquist → stays at Hz.
  • Hz is above Nyquist → Hz. Both land on 300 Hz. They are now indistinguishable — a permanent, irreversible collision. Look at Figure s01: the fast wave folds down and sits exactly on the slow one.
Figure — ADC - DAC — resolution, sampling rate, Nyquist

No later processing can un-mix them. This is why the anti-alias filter must live before the ADC.

Problem 3.2

You have a 12-bit ADC. Someone upgrades it to 16 bits hoping to remove the aliasing seen in 3.1. Does it help? Explain in terms of what each parameter controls.

Recall Solution

No. Bits control amplitude precision; aliasing is a time/frequency corruption. The 16-bit part will record the fake 300 Hz alias more precisely — a sharper picture of the wrong thing. The only fixes are: (a) raise above Hz, or (b) low-pass filter out the 1700 Hz tone before sampling. See Anti-Aliasing Filters.

Problem 3.3

Show why sampling exactly at can fail. Take Hz, Hz, and sample at .

Recall Solution

WHAT we compute: the sample values at each instant . Every sample is zero. Figure s02 shows the dots landing exactly on the zero-crossings.

Figure — ADC - DAC — resolution, sampling rate, Nyquist

A flat line of zeros is indistinguishable from a silent signal — the amplitude is lost. This is precisely why Nyquist is a strict inequality , not .


L4 — Synthesis

Problem 4.1

Design a data-acquisition chain for a vibration sensor whose useful signal tops out at kHz. You want (a) a sampling rate with margin over the Nyquist minimum, (b) at least dB of SNR, and (c) an LSB no larger than mV on a V reference. Choose and , and state the anti-alias filter cut-off.

Recall Solution

Step 1 — sampling rate. Nyquist minimum is Hz. Add : Choose kHz (or a standard 22.05 kHz if a codec chip forces it).

Step 2 — bits from SNR. Need :

Step 3 — bits from LSB. Need mV, i.e. , so (since ).

Step 4 — combine. Take the larger bit requirement: bits (rounds up to a real 16-bit part). Check LSB at 16 bits: mV — comfortably under mV. ✓

Step 5 — filter. Anti-alias low-pass cut-off just below Nyquist kHz (pass the 8 kHz signal, kill everything above 10 kHz). See Zero-Order Hold & Reconstruction for the matching DAC-side smoothing filter.

Final design: kHz, bits (16-bit part), anti-alias cut-off kHz.

Problem 4.2

For the chain above, the DAC replays the samples. Explain what the staircase does in the frequency domain and where the reconstruction filter's cut-off goes.

Recall Solution

The DAC holds each sample for s (zero-order hold), making a staircase. Those sharp steps inject spectral images — copies of the signal centred at multiples of (20 kHz, 40 kHz, ...). A reconstruction low-pass filter with cut-off kHz erases the steps, keeping only the original band. See Fourier Transform & Frequency Domain for why hard edges = high-frequency content.


L5 — Mastery

Problem 5.1

A sensor outputs a kHz tone plus wideband noise up to kHz. You must sample at kHz. Design constraints: after sampling, no aliased energy from the noise may fall inside the kHz band of interest. What order of low-pass filter roll-off (in decades of attenuation) do you need if the noise at kHz must be pushed dB below the signal, and the filter starts rolling at kHz? Also state where the kHz tone itself ends up (aliased or not).

Recall Solution

Part A — is the 9 kHz tone safe? Nyquist kHz. Since , the tone is below Nyquist → not aliased, it stays at 9 kHz. ✓

Part B — the noise fold. Anything above 10 kHz folds into 0–10 kHz. Noise at 50 kHz aliases to kHz worth of fold — it lands right at the band edge. So the filter must attenuate the noise between 10 kHz and 50 kHz before it folds.

Part C — filter roll-off. From the filter's corner at kHz to the worst noise at kHz is a frequency ratio of , i.e. decades. We need dB of attenuation across that span: A standard filter gives dB/decade per order (), so: A 5th-order anti-alias filter. See Anti-Aliasing Filters.

Problem 5.2

You capture the 9 kHz tone with a 14-bit ADC ( V) and later realise the true signal amplitude only swings V (using of full scale). What is your effective SNR, and how many effective bits did you lose by not amplifying the signal to full scale?

Recall Solution

WHAT: SNR scales with how much of full scale the signal uses. WHY: quantization noise is fixed by the LSB (it doesn't shrink when your signal shrinks), so a small signal has a worse ratio.

Full-scale SNR at 14 bits: dB.

The signal swing is V out of V (half of ), i.e. fraction of full scale. Amplitude loss in dB: Effective SNR: Bits lost: each dB bit, so bits lost. You threw away roughly 2.3 effective bits by under-driving the ADC — a 14-bit part behaving like an -bit one. Fix: add gain before the ADC to fill the range. See Sensor Interfacing on Microcontrollers.


Connections

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