This page is the drill-ground for the parent topic . We take every kind of situation the ideas of resolution , sampling rate , and Nyquist can produce — and we work each one out loud, from zero. Nothing here uses a symbol the parent note did not build, and where a new one appears we re-earn it.
Intuition How to read this page
First you meet a scenario matrix : a table naming every distinct kind of problem this topic can throw at you. Then each worked example is stamped with the matrix cell it covers, so by the end no cell is left blank. Try to answer the "Forecast:" line before reading the steps — guessing first is what makes it stick.
Every problem in this topic is really one of a small number of shapes . Here they are.
#
Cell (the kind of case)
What makes it tricky
Covered by
A
Resolution — normal
plain LSB / code arithmetic
Ex 1
B
Resolution — boundary / full-scale
the "2 N vs 2 N − 1 " trap at the top code
Ex 2
C
Resolution — degenerate (1 bit, tiny signal)
signal smaller than 1 LSB → dead code
Ex 3
D
Sampling — below Nyquist (aliasing)
frequency folds back
Ex 4
E
Sampling — above Nyquist (safe)
verify no folding, find margin
Ex 5
F
Sampling — exactly at 2 f (the limiting value)
boundary is NOT safe
Ex 6
G
Multiple tones / choosing f s
must clear the highest frequency
Ex 7
H
Real-world word problem
translate words → numbers → filter choice
Ex 8
I
Exam twist (SNR ↔ bits, backwards)
solve the 6.02N formula in reverse
Ex 9
J
DAC reconstruction — staircase
zero-order hold, images above f s /2
Ex 10
We will hit A → J in order. First, a shared picture of the two axes every problem lives on.
Recall The three formulas we will reuse (all from the parent)
Full-scale range V r e f split into 2 N codes with 2 N − 1 gaps ::: LSB = 2 N − 1 V r e f ≈ 2 N V r e f
Code from a voltage ::: code = round ( V r e f V in × ( 2 N − 1 ) )
Nyquist rule ::: f s > 2 f ma x ; Nyquist frequency f N = f s /2
Alias frequency ::: f a l ia s = f − f s ⋅ round ( f s f )
SNR ceiling ::: SNR m a x = 6.02 N + 1.76 dB
Here N is the number of bits (the count of yes/no switches), V r e f is the reference voltage (the top of the input range), f is a signal frequency in hertz, and f s is the sampling rate in samples per second. Nothing else is assumed.
Worked example Ex 1 — Step size and code of a 10-bit ADC
A 10-bit ADC has V r e f = 5 V . (a) What voltage does one code step represent? (b) What code comes out for an input of 3 V ?
Forecast: guess — is one step closer to 5 mV or 5 μ V ? Will the code for 3 V be nearer 600 or nearer 6000 ?
Step 1. Count the codes: 2 10 = 1024 .
Why this step? N = 10 independent binary switches count from 0 to 2 10 − 1 , so there are 1024 distinct levels.
Step 2. Find the LSB (the step between neighbouring levels):
LSB = 2 N − 1 V r e f = 1023 5 ≈ 4.888 mV .
Why 2 N − 1 and not 2 N ? There are 1024 fence-posts but only 1023 gaps between them — the step size is a gap .
Step 3. Convert 3 V to a code:
code = round ( 5 3 × 1023 ) = round ( 613.8 ) = 614.
Why round? The ADC is a mid-tread quantizer — it snaps the input to the nearest level, not the floor.
Verify: code 614 represents 614 × 4.888 mV ≈ 3.001 V — back to 3 V within half an LSB (≈ 2.4 mV ). ✓ Units: volts in, volts out. ✓
Worked example Ex 2 — What is the highest code, and what voltage is it?
Same 10-bit, 5 V ADC. What is the largest code, and what input voltage produces it? Show why using 2 N instead of 2 N − 1 would misplace full scale.
Forecast: is the top code 1024 or 1023 ? Does it sit at 5 V or just below?
Step 1. Highest code = 2 N − 1 = 1023 .
Why this step? Codes run 0 , 1 , … , 1023 . Zero is a valid code, so the count 1024 includes it; the maximum index is one less.
Step 2. Voltage of code 1023 with the exact LSB:
1023 × 1023 5 = 5.000 V .
Why this matters: with the exact LSB = V r e f / ( 2 N − 1 ) , the top code lands exactly on full scale — clean.
Step 3. Now the trap — using the approximation LSB ≈ V r e f / 2 N = 5/1024 ≈ 4.883 mV :
1023 × 4.883 mV ≈ 4.995 V .
Why show this? The approximate LSB places the top code ≈ 5 mV below 5 V — a full step short. For large N that error is invisible; near full scale it is exactly one LSB of bias.
Verify: difference 5.000 − 4.995 = 0.005 V = 1 LSB . The gap between the two conventions is exactly one step, as claimed. ✓
Worked example Ex 3 — A 1-bit converter and a tiny signal
Extreme edge. V r e f = 3.3 V . (a) What is the LSB of a 1-bit ADC? (b) A sensor produces a swing of only 0.5 V around 0 . What codes appear?
Forecast: how many levels does 1 bit give? Can a 0.5 V wiggle even be seen ?
Step 1. Codes for N = 1 : 2 1 = 2 (just 0 and 1 ). Gaps = 2 1 − 1 = 1 .
LSB = 2 1 − 1 3.3 = 3.3 V .
Why this step? One switch = two states = one giant step spanning the whole range. That is the coarsest possible converter.
Step 2. Feed in 0.5 V :
code = round ( 3.3 0.5 × 1 ) = round ( 0.1515 ) = 0.
Why this result? The nearest level to 0.5 V is code 0 (which represents 0 V ). The 0.5 V signal is smaller than the ± 2 1 LSB = ± 1.65 V decision band, so it never flips the bit.
Step 3. The whole 0.5 V waveform stays at code 0 — it is invisible .
Why this is the degenerate case: any input change smaller than 2 1 LSB lands in the same code. This is the "dead code" limit the parent warned about ("any change smaller than ~0.8 mV cannot be seen"), pushed to an extreme.
Verify: 2 1 LSB = 1.65 V > 0.5 V , so no threshold is crossed → code stays 0 . ✓ (Fix in real life: amplify the sensor first, or use more bits — see Sensor Interfacing on Microcontrollers .)
Worked example Ex 4 — A tone that lies about its frequency
A 7 kHz pure tone is sampled at f s = 10 kHz . What frequency will you hear on playback?
Forecast: 7 kHz is above Nyquist — guess the fake frequency before computing. Higher or lower than 5 kHz ?
Step 1. Nyquist frequency f N = f s /2 = 5 kHz . Since 7 > 5 , the rule f s > 2 f ma x is broken → aliasing happens.
Why this step? Only content strictly below f N is safe. Anything above folds.
Step 2. Apply the alias formula:
f a l ia s = 7 − 10 ⋅ round ( 10 7 ) = ∣ 7 − 10 ⋅ 1 ∣ = 3 kHz .
Why round(7/10)=1? 0.7 rounds to the nearest whole number of full sampling-rate hops, which is 1 . The tone is 3 kHz on the other side of f s .
Step 3. Interpretation: a 7 kHz input is recorded as a false 3 kHz tone.
Why it disguises: cos ( 2 π ⋅ 7000 t ) and cos ( 2 π ⋅ 3000 t ) hit identical values at every sample instant t = n /10000 .
Verify: 3 kHz < f N = 5 kHz ✓ (a valid, representable frequency). And 7000 and 3000 differ by exactly 10000 = f s — a folding partner. ✓ See the folding picture below.
Worked example Ex 5 — Is this design safe, and by how much?
A signal contains nothing above 4 kHz . It is sampled at f s = 44.1 kHz . Is it aliased? What is the safety margin ratio f s / ( 2 f ma x ) ?
Forecast: obviously safe — but guess: is the margin close to 2 × , 5 × , or huge?
Step 1. Nyquist frequency f N = 44100/2 = 22050 Hz . Highest content = 4000 Hz .
Why this step? We compare the highest real frequency to f N .
Step 2. 4000 < 22050 , so f s > 2 f ma x holds → no aliasing .
Why: nothing pokes above the fold line, so nothing folds back.
Step 3. Margin ratio:
2 f ma x f s = 2 × 4000 44100 = 8000 44100 ≈ 5.51.
Why compute this? The parent recommends ≥ 2.5 × for filter roll-off room; here we are oversampling ∼ 5.5 × , very comfortable.
Verify: apply the alias formula as a sanity check — round ( 4000/44100 ) = round ( 0.0907 ) = 0 , so f a l ia s = ∣4000 − 0∣ = 4000 Hz : unchanged, no fold. ✓
Worked example Ex 6 — Why "
f s = 2 f " is a trap
A 500 Hz sine is sampled at exactly f s = 1000 Hz = 2 f . Show that reconstruction can fail even though the arithmetic "just satisfies" 2 f .
Forecast: the parent says the Nyquist condition is strict (> , not ≥ ). Guess what goes wrong at the exact boundary.
Step 1. Sample instants: t = n /1000 seconds. The sine is sin ( 2 π ⋅ 500 t ) .
Why sine here? We deliberately pick a phase where the danger shows: choosing sine means the samples can hit the zero crossings.
Step 2. Evaluate at each sample:
sin ( 2 π ⋅ 500 ⋅ 1000 n ) = sin ( π n ) = 0 for every integer n .
Why this step? 500/1000 = 2 1 , so each step advances the angle by exactly π — always landing on a zero crossing.
Step 3. Every sample is 0 . The recorded signal is silence — the amplitude is lost.
Why this is the boundary lesson: at f s = 2 f the two samples per period can both sit on zeros, so amplitude (and hence the tone) is not guaranteed to survive. That is exactly why the condition is f s > 2 f ma x , strict.
Verify: sin ( π n ) = 0 for n = 0 , 1 , 2 , 3 → the sampled sequence is all zeros, confirming the failure. ✓
Worked example Ex 7 — Three tones, one sampling rate
A signal is the sum of 300 Hz , 2.5 kHz , and 9 kHz tones. What is the minimum sampling rate to capture all three without aliasing?
Forecast: which tone sets the rule? Guess the minimum f s .
Step 1. Find f ma x = the highest frequency present = 9 kHz .
Why this step? Nyquist cares only about the top frequency — one tone above the fold ruins everything.
Step 2. Apply the strict rule:
f s > 2 f ma x = 2 × 9000 = 18000 Hz .
Why strict? From Ex 6, exactly 18 kHz risks the zero-crossing failure; pick anything above it.
Step 3. Add the practical margin the parent recommends (≥ 2.5 × for filter roll-off):
f s ≈ 2.5 × 9000 = 22500 Hz ⇒ pick a standard f s ≥ 22.5 kHz (e.g. 44.1 kHz).
Why round up to a standard rate? Real hardware clocks come in standard values; overshoot is free safety.
Verify: at f s = 18000 , the lower tones alias-check: round ( 300/18000 ) = 0 and round ( 2500/18000 ) = 0 , so both pass through unchanged (f a l ia s = 300 and 2500 ). Only the 9 kHz tone sits at the boundary, confirming it is the binding constraint. ✓
Worked example Ex 8 — Temperature logger design
You log a room temperature that ranges 0 –3.3 V from a sensor. You need to resolve steps of 1 mV or finer. (a) Minimum number of bits? (b) The signal's fastest meaningful variation is 2 Hz — what minimum f s , and do you need an anti-alias filter?
Forecast: guess the bit count — 8, 10, or 12? And is 2 Hz a demanding sampling problem?
Step 1. Bits from the resolution requirement. We need LSB ≤ 1 mV :
2 N − 1 3.3 ≤ 0.001 ⇒ 2 N − 1 ≥ 3300 ⇒ 2 N ≥ 3301.
Why this inequality? Smaller LSB needs more levels; more levels need more bits.
Step 2. Solve: 2 11 = 2048 (too few), 2 12 = 4096 ≥ 3301 (enough). So N = 12 bits.
Why round up? You cannot buy a fractional bit; you take the next whole bit that clears the requirement.
Step 3. Check the achieved LSB: LSB = 3.3/4095 ≈ 0.806 mV ≤ 1 mV ✓.
Why re-check? Confirms the chosen bit count actually meets the 1 mV spec.
Step 4. Sampling: f ma x = 2 Hz , so f s > 4 Hz . Even 10 Hz is generous.
Anti-alias filter? Temperature physically cannot change at kilohertz rates, so there is little high-frequency energy to fold — a simple RC low-pass (cutoff a few Hz) is enough. See Anti-Aliasing Filters .
Verify: 2 12 = 4096 > 3301 ✓ and LSB = 3.3/4095 = 0.806 mV < 1 mV ✓; f s = 10 > 4 ✓.
Worked example Ex 9 — How many bits for 80 dB of SNR?
An audio ADC must reach at least 80 dB of signal-to-noise ratio. Using the ideal ceiling SNR m a x = 6.02 N + 1.76 dB , find the minimum N .
Forecast: roughly 6 dB per bit, so guess — 12 bits? 14? 16?
Step 1. Set the ceiling to meet the spec and solve for N :
6.02 N + 1.76 ≥ 80 ⇒ 6.02 N ≥ 78.24 ⇒ N ≥ 12.997.
Why solve this way? SNR grows linearly in N ; we invert the line to get the bit count.
Step 2. Round up to the next whole bit: N = 13 .
Why up, not nearest? N = 12.997 is just short of 80 dB ; N = 13 is the smallest integer that clears the spec.
Step 3. Confirm what 13 bits delivers:
SNR m a x = 6.02 × 13 + 1.76 = 80.02 dB ≥ 80 dB .
Why check? Ensures we did not under-round.
Verify: N = 12 gives 6.02 × 12 + 1.76 = 74.0 dB < 80 (fails), N = 13 gives 80.02 dB ≥ 80 (passes) — so 13 is genuinely the minimum. ✓ (More on this in Quantization Noise & SNR .)
Worked example Ex 10 — Zero-order hold staircase and its images
A DAC outputs codes at f s = 8 kHz , holding each sample constant for one period (zero-order hold). The wanted signal is a 1 kHz tone. (a) How long is each held step? (b) Where do the first spectral "image" copies land, and what cutoff should the reconstruction filter use?
Forecast: guess the step duration, and guess whether the junk images sit near 1 kHz or up near 8 kHz .
Step 1. Step (hold) duration:
T s = f s 1 = 8000 1 = 125 μ s .
Why this step? Each sample is held for exactly one sampling period, producing the flat treads of the staircase.
Step 2. Zero-order hold creates copies (images) of the signal spectrum around every multiple of f s . The nearest images of the 1 kHz tone appear at:
f s − 1 kHz = 7 kHz and f s + 1 kHz = 9 kHz .
Why here? The staircase's sharp steps are built from high-frequency content — mathematically, mirror copies of the baseband tone sit at ∣ k f s ± f ∣ .
Step 3. Reconstruction filter cutoff at the Nyquist frequency:
f c ≈ f N = 2 f s = 4 kHz .
Why f s /2 ? It passes the wanted 1 kHz tone (below 4 kHz ) while blocking the 7 kHz and 9 kHz images — smoothing the staircase back to a clean sine. See Zero-Order Hold & Reconstruction .
Verify: wanted 1 kHz < 4 kHz (passes) ✓; first image 7 kHz > 4 kHz (blocked) ✓; step time 125 μ s × 8000 = 1 full second of samples per 8000 steps — consistent with f s = 8 kHz . ✓
Mnemonic Which cell am I in?
Ask two questions. "Is this an amplitude question or a time question?" Amplitude → bits/LSB/SNR (cells A–C, I). Time → Nyquist/aliasing/DAC (cells D–H, J). Then: "Am I on a boundary?" Boundaries (2 N − 1 , exactly 2 f , top code) are where the traps live.
ADC - DAC — resolution, sampling rate, Nyquist (index 5.5.4) — the parent topic
Quantization Noise & SNR — the 6.02 N + 1.76 ceiling used in Ex 9
Anti-Aliasing Filters — the fix for cells D and H
Zero-Order Hold & Reconstruction — the staircase of Ex 10
Fourier Transform & Frequency Domain — why images and folding exist
Successive Approximation vs Sigma-Delta ADC — how these numbers become hardware
Sensor Interfacing on Microcontrollers — the dead-code fix from Ex 3