Chapters

24 Sampling and Aliasing

fundamentals
signal
processing
adc

24.1 In 60 Seconds

Prove the Digital Number Still Represents the Signal

Picture a pressure sensor whose stored values flatten near the top of its range. More samples cannot repair a signal that the input stage has already clipped.

An analog-to-digital converter means the part that turns a changing voltage into numbers. ADC is the short name used here. State its input range, resolution, reference, sample timing, and filter before trusting the output.

Apply known low, middle, high, over-range, and changing inputs. Keep the source value, raw code, time, reference, settings, plot, and error so another person can repeat the check.

This test covers one input path and chosen signals, not every noise source. The deeper sections develop sampling, aliasing, scaling, filtering, calibration, and uncertainty.

An ADC makes a timed digital record of a changing analog voltage. A trustworthy sample plan starts with the physical signal, limits misleading high-frequency content before conversion, samples fast enough with margin, and records the range, reference, bit depth, timestamp policy, and validation evidence that make each code meaningful.

24.2 Start With the Story

You will choose sampling and conversion settings that preserve the signal instead of creating misleading digital patterns. Start with the signal’s bandwidth and range before choosing a filter, sample rate, or bit depth.

Follow one waveform across four beats to see how filtering, sample rate, and converter fit determine the digital evidence.

  1. Physics Phoebe and Ada observe an analog sensor waveform beside a prepared sampling clock and converter.

    Physics Phoebe: “The analog signal has a band and range the converter must respect.”

  2. Physics Phoebe, Ada, and Bex compare a fast original waveform with sparse samples that reconstruct a false slower trace.

    Bex: “Sample too slowly and a different waveform can appear plausible.”

  3. Physics Phoebe, Ada, and Data Dora place an anti-alias filter before a densely clocked, range-fitted converter.

    The team: “Bound the signal, filter it, then choose sample rate and resolution together.”

  4. Physics Phoebe, Ada, and Test Tessa verify dense digital samples against the filtered analog waveform and retained record.

    Test Tessa: “The digital trace now matches the bounded signal we intended to measure.”

ADC evidence is defensible when filtering, sampling, range, and resolution fit the signal together.

24.3 What the ADC Promises

An analog-to-digital converter, or ADC, is the snapshot gate between the physical world and the firmware record. A sensor produces a changing voltage. The ADC samples that voltage at scheduled moments and stores each result as a number.

The important idea is not "sample as fast as possible." The important idea is trust: a digital sample should still mean the physical thing it claims to mean.

If you only need the intuition, this layer is enough: choose a snapshot speed that is fast enough for the real signal, block misleading high-frequency content before it reaches the ADC, and use enough resolution to see the meaningful voltage changes.

Think of a flipbook. If you photograph a moving wheel often enough, the pages show the wheel turning in the correct direction. If you take too few photos, the same wheel can look slower, stopped, or even reversed. That false motion is aliasing. In ADC work, aliasing can turn high-frequency vibration, electrical noise, or switching ripple into a believable low-frequency pattern.

For example, an irrigation pump monitor might use a 0.5 V to 4.5 V pressure transducer on an STM32 or ESP32 SAR ADC. The dashboard may only need one pressure value each second, but the ADC path still needs to preserve pump ripple, cavitation pulses, and mains-coupled noise before the firmware decides what to summarize. A defensible design may sample around hundreds of samples per second, put an RC or active low-pass filter before the ADC input, and then report a one-second pressure statistic with a timestamp and scale factor. If the firmware sampled once per second directly, the data table would still fill with numbers, but a fast pressure pulse or electrical ripple could fold into a false slow drift.

The next What the ADC Promises decision depends on the diagram Figure 24.1. Reading ANALOG INPUT against 1. Sensor signal clarifies the practical meaning of ADC pipeline: signal conditioning, anti-alias filtering, sample timing, quantization, and a digital evidence record.

Analog-to-digital conversion pipeline in order: a continuous analog sensor voltage, an anti-alias filter that removes content above the band of interest, a sample-and-hold stage that makes time discrete, and quantization that produces the digital output the firmware reads.
Figure 24.1: ADC pipeline: signal conditioning, anti-alias filtering, sample timing, quantization, and a digital evidence record.

Read Figure 24.1 downward from continuous sensor voltage through the anti-alias filter. Sample and hold makes time discrete; the final converter stage makes amplitude discrete before firmware receives a code.

The One-Minute ADC Decision

Name the useful signal

Start with the physical change the system must preserve, such as room temperature drift, motor vibration, or a pressure pulse.

Protect the sample

Put analog conditioning and anti-alias filtering before conversion so unwanted fast content does not become false evidence.

Record the meaning

Keep the sample rate, voltage range, reference, bit depth, timestamp policy, and validation notes together.

Beginner Examples

  • A greenhouse temperature sensor may only need one trustworthy reading every few seconds because the room changes slowly.
  • A vibration monitor may need hundreds or thousands of readings per second because the useful fault pattern changes quickly.
  • A higher-resolution ADC does not fix a wrong sample rate. More digits can still describe the wrong waveform.

Aliasing Warning Knowledge Check

If this gives you enough to recognize the risk, you can stop here. Continue to Practitioner when you need to design or review the sample path.

24.4 Apply It: Build the ADC Sample Plan

The practical ADC workflow starts with the signal requirement and ends with a short review record. The record matters because a sample rate that made sense in the lab can become wrong after a sensor, filter, enclosure, timer, or power rail changes.

Walkthrough: From Sensor Voltage to Digital Evidence

  1. State the measurement. Name the physical quantity, expected range, fastest useful change, and acceptable delay.
  2. Condition the voltage. Scale or shift the sensor output so it fits the ADC input range without clipping or wasting most codes.
  3. Filter before sampling. Place the anti-alias boundary in the analog path. Digital filters cannot reliably remove content after it has folded into the sampled band.
  4. Choose the sample rate. Start above twice the highest useful frequency, then add margin for filter rolloff, clock tolerance, jitter, and validation uncertainty.
  5. Check resolution. Make sure one ADC code step is smaller than the meaningful physical change and larger than pure noise.
  6. Validate and record. Use a known input, reference capture, or repeatable field test to prove the code record still maps to the physical signal.

An ADC selection guide keeps three reviews separate. Signal bandwidth drives the sample-rate and anti-alias plan; sensor accuracy and noise decide whether extra bits are useful; power budget constrains whether a faster or higher-resolution converter is practical for a battery device. Treat those as linked engineering choices instead of selecting the largest bit depth on the data sheet.

Read the three questions across the top of Figure 24.2 before looking at the converter recommendations below. Signal speed, sensor accuracy, and power budget constrain different parts of the choice.

ADC selection guide comparing signal speed, sensor accuracy, and power budget questions before recommending 8-bit, 10- to 12-bit, or 16-bit conversion ranges.
Figure 24.2: ADC selection guide: bandwidth, accuracy, and power budget set the converter choice together.

Inspect the recommendations across the lower row of Figure 24.2, moving from coarse battery sensing toward precise, powered measurements. The upper questions explain these differences; extra converter bits are useful only when the sensor and noise level justify them.

Connect Walkthrough: From Sensor Voltage to Digital Evidence to the visual Figure 24.3 by locating Useful and signal band. The pair turns Nyquist decision map: useful bandwidth, filter cutoff, transition margin, and selected sample rate into something the team can verify.

Nyquist decision map showing useful signal bandwidth, anti-alias filter cutoff, transition margin, and selected sample rate.
Figure 24.3: Nyquist decision map: useful bandwidth, filter cutoff, transition margin, and selected sample rate.

Trace Figure 24.3 through Useful, signal band, and Filter. At the first stop, the diagram highlights Useful; at the second it highlights signal band; at the third it highlights Filter. Those hand-offs make Nyquist decision map: useful bandwidth, filter cutoff, transition margin, and selected sample rate actionable within Walkthrough: From Sensor Voltage to Digital Evidence.

Worked Example: Temperature Sensor on a 12-Bit ADC

Assume a temperature sensor produces 10 mV for each 1 degree C, and the conditioned output spans 0.1 V to 1.75 V. A 12-bit ADC using a 3.3 V reference has 4096 possible codes.

Review Step
Calculation
Result
Meaning
Voltage per code
3.3 V / 4096
0.806 mV per code
Each count is about 0.08 degrees C for this sensor scale.
Useful range
1.75 V - 0.1 V
1.65 V span
The sensor uses about half the ADC input range, so there is useful but not perfect code coverage.
Timing question
Fastest meaningful temperature event
Application-specific
Temperature usually changes slowly, but airflow, heater cycling, or diagnostics may set the real sample need.
Validation
Known temperatures and raw code log
Calibration evidence
The team can reproduce the voltage-to-temperature conversion later.

The calculation says the ADC has enough amplitude detail for many temperature tasks. It does not prove that the sample rate, reference stability, or calibration are good. Those are separate gates.

Try It: Sampling and Aliasing Visualizer

Use the ADC visualizer to move the signal frequency and sample rate. Watch the sample points thin out as the sample rate approaches the signal, then cross the Nyquist boundary to see the false lower-frequency pattern.

Incremental Practice

Beginner

For a slowly changing environment reading, justify why a low sample rate still preserves the useful signal.

Intermediate

For a vibration signal up to 40 Hz, record why the mathematical lower boundary is above 80 samples/s and why the real design needs more margin.

Advanced

Inject a known high-frequency component before the ADC and verify that the analog filter keeps it from folding into the band of interest.

Sample-Rate Review Knowledge Check

If your job is to choose a defensible sample rate and record why it works, you can stop here. Continue to Under the Hood for the formulas behind the review.

24.4.1 Interactive: Separate Nominal Bits from Useful Resolution

The sample plan is incomplete until voltage resolution, input noise, sensor sensitivity, and observation time are read from the same ledger. Open the sensor-specification preset below, keep the 3.30 V range and 12-bit converter fixed, and change only the averaging count from 1 to 64. The visible gain in effective bits is purchased with a longer acquisition window; nominal ADC width has not changed.

Carry both results into the sample-plan record. A design that reports the smaller uncertainty but omits the longer observation time has described only half of the trade-off.

24.5 Under the Hood: Math, Limits, and Failure Modes

The deeper layer explains why the practitioner workflow separates sampling, filtering, resolution, and evidence. Each gate answers a different physical question.

Sampling Boundary

The Nyquist rule gives the minimum sampling boundary for a highest useful frequency:

f_s > 2 f_max

This boundary assumes the signal above the useful band has been removed before sampling. Real anti-alias filters have transition bands. A practical design usually samples faster than the bare minimum so the filter has room to attenuate unwanted content.

Alias Frequency

When a sinusoidal component at frequency f is sampled at f_s, a useful way to estimate the folded frequency is:

f_alias = |f - f_s x round(f / f_s)|
  • A 90 Hz signal sampled at 100 samples/s aliases to 10 Hz.
  • A 1200 Hz component sampled at 1000 samples/s aliases to 200 Hz.
  • Two different high-frequency components can fold into the same apparent low-frequency band, which makes post-processing ambiguous.

Compare the real waveform on the left of Figure 24.4 with the reconstructed patterns beside it. The middle panel shows how insufficient sampling turns the original signal into a false lower-frequency pattern.

Signal aliasing and sampling scenarios showing why the sampling rate determines whether digital data reflects reality: a real 50 Hz signal, an undersampled case at 80 Hz whose Nyquist limit of 40 Hz produces a false 30 Hz alias and a dashboard fault, and a properly sampled case that faithfully reconstructs the signal.
Figure 24.4: Aliasing map: content above the representable band folds into a false lower-frequency pattern.

In Figure 24.4, sampling the 50 Hz signal at 80 Hz produces the false 30 Hz result in the middle panel. The right panel combines a higher sample rate with anti-alias filtering to preserve the original waveform.

Resolution and Quantization

For an ideal ADC with reference voltage V_ref and N bits:

LSB = V_ref / 2^N

The ideal quantization error is within plus or minus half an LSB. For a 12-bit, 3.3 V ADC, one LSB is about 0.806 mV, so the ideal quantization uncertainty is about +/-0.403 mV.

Ideal signal-to-quantization-noise ratio is often approximated as:

SNR_ideal = 6.02N + 1.76 dB

For 12 bits, that is about 74 dB. Real systems often deliver fewer effective bits because of input noise, reference drift, source impedance, aperture jitter, layout coupling, and calibration error. Effective number of bits can be estimated from a measured SNR:

ENOB = (SNR_measured - 1.76) / 6.02

The mathematical gist. A 40 Hz signal needs at least 80 samples/s before filter margin, while 90 Hz sampled at 100 samples/s folds to 10 Hz. Separately, a 12-bit, 3.3 V converter has a 0.806 mV code width, 0.403 mV half-code bound, and 74.0 dB ideal quantisation SNR. Sampling rate protects the time axis; bit depth divides the voltage axis.

Math Bridge · guided foundationsHow do time samples and voltage codes fail differently?Let Sammy separate aliasing from quantisation, then vary bit depth without losing the chapter's sampling checks.

Inspect the figure Figure 24.5 before carrying {#depth-boundary-signal-processing-adc-fundamentals-1-close .unlisted .unnumbered .depth-l2 .depth-boundary} forward. Requirement and band, range identify the evidence boundary implicit in ADC review record: requirement, signal path, validation evidence, and change trigger.

ADC review record showing signal requirement, filter, sample rate, resolution, validation, and change trigger.
Figure 24.5: ADC review record: requirement, signal path, validation evidence, and change trigger.

Read the upper row of Figure 24.5 from the requirement through the signal path to the sample plan. Continue below to check resolution against noise and validate with a known input; revisit the record after design changes.

Gate
Question
Evidence
Failure If Missing
Signal range
Does the conditioned signal fit the ADC input range?
Minimum, maximum, offset, reference, and headroom.
Clipping, dead zones, or wasted resolution.
Bandwidth
What is the fastest useful change the application must preserve?
Sensor dynamics, physical process, fault signatures, and noise sources.
Sampling a decorative noise band or missing the useful signal.
Filter
What high-frequency content must be attenuated before sampling?
Analog filter cutoff, order, settling, and tolerance.
Aliasing that cannot be repaired by later software.
Code record
What does one digital sample mean?
Bit depth, reference, conversion mode, timestamp, units, and calibration.
Correct-looking numbers with unclear scale or timing.

Common Pitfalls

  1. Treating Nyquist as the final answer. The rule gives a lower boundary. It does not choose the filter, margin, validation method, or timing policy.
  2. Trying to remove aliasing after conversion. Once high-frequency content folds into the sampled band, software may not know which low-frequency pattern is real.
  3. Buying more bits before checking noise. Extra resolution can create precise-looking numbers that only describe reference drift, noise, or poor range use.
  4. Ignoring timestamp policy. A correct voltage code is not enough if the system cannot prove when the sample was taken.

Alias Frequency Knowledge Check

Aliasing Symptom Diagnosis

Symptom
Likely Cause
Evidence to Collect
First Fix to Try
Pattern moves with sample rate
The sampled pattern is tied to timing, not the physical event.
Capture the same input at two defensible sample rates.
Raise sample rate and review analog filtering.
Slow pattern seems physically impossible
A fast component may be folding into the measured band.
Inspect analog signal or compare with an independent reference.
Add or tighten anti-alias filtering before the ADC.
Digital filter does not remove the issue
The unwanted component may already be folded into the data.
Compare pre-ADC signal and sampled data.
Filter before conversion, not only after conversion.

Analog and Digital Filter Boundary

Filter Type
Where It Acts
What It Can Fix
What It Cannot Fix
Anti-alias filter
Before sample-and-hold and ADC conversion.
Reduces unwanted high-frequency content before it folds into sampled data.
Cannot repair ambiguous units, bad calibration, or downstream packet issues.
Digital smoothing
After the ADC has produced a sample stream.
Reduces random noise or creates a more stable display value.
Cannot reliably remove a folded alias that already looks like a real signal.
Outlier handling
After conversion, often in firmware.
Suppresses isolated spikes when they are not meaningful events.
Cannot replace sensor placement, shielding, grounding, or anti-alias design.

At this depth, the ADC decision is a chain of limits: analog bandwidth, filter attenuation, sampling rate, reference, noise, timing, and validation. A trustworthy sample plan records each limit instead of treating the ADC code as self-explanatory.

24.6 Summary

  • ADC design starts with the signal requirement, not the fastest available sample rate.
  • Nyquist gives a lower boundary, while real designs need filter and implementation margin.
  • Aliasing creates false patterns that can survive into dashboards and analytics.
  • Anti-alias filtering must happen before sampling because digital cleanup cannot reliably undo folded content.
  • Resolution depends on the whole signal path: range, noise, reference, timing, and calibration.
  • A review record keeps the design reproducible when sensors, firmware, filters, or deployment conditions change.
Key Takeaway

A trustworthy ADC path is evidence-led: useful bandwidth, analog filtering, sample timing, range, reference, resolution, and validation all have to agree.

24.7 See Also

Quantization and Digital Filtering

Review amplitude resolution, code steps, and digital filtering after conversion.

Sensor Dynamics and Response

Connect ADC sampling decisions to the sensor's physical response time and bandwidth.