Chapters

28 Sampling and Aliasing: Nyquist and Filters

electronics-controller-design
analog
digital
nyquist
adc
mixed-signal
signal-chain
binary
sensors
firmware

28.1 Start With the Decision

A sensor can report a slow false wave when it samples a fast real signal. Sampling rate and filtering must protect the measurement before analysis begins.

28.2 Route Overview

This is part 1 of 3. Continue with Sampling Design: Product Scenarios.

28.3 Part Objectives

  • Apply the Nyquist condition to a bounded sensor signal.
  • Explain how aliasing and anti-alias filters change sampled evidence.

28.4 Start Simple

Prove a Fast Signal Does Not Become a Slow Lie

Picture a vibration monitor that reports a gentle wobble while the machine is shaking much faster. The stored trace may be neat and still be false.

Sampling rate means how many measurements are taken each second. State the fastest signal of interest and what the input filter removes before choosing that rate.

Apply a known slow tone, a near-limit tone, and one above the limit. Keep the source frequency, filter, sampling rate, raw samples, spectrum, and false component so another person can repeat the check.

This check covers chosen tones and one signal path, not every transient. The deeper sections develop aliasing, limits, filtering, oversampling, and reconstruction.

Imagine measuring vibration but sampling so slowly that a fast wobble appears as a slow false pattern. Nyquist sampling is the rule that prevents a changing signal from pretending to be something else. Start with the highest frequency you need to trust, then choose sample rate and filtering before collecting data.

In 60 Seconds

The Nyquist-Shannon sampling theorem states that you must sample an analog signal at least twice its highest frequency component (f_sample >= 2 x f_max) to accurately reconstruct it digitally. Sampling too slowly causes aliasing — high frequencies masquerade as lower ones, corrupting your data. In practice, IoT engineers oversample at 2.5-5x and add hardware anti-aliasing filters to ensure reliable sensor readings.

Key Concepts
  • Nyquist-Shannon Sampling Theorem: A continuous signal can be perfectly reconstructed from its samples if the sampling rate fs is at least 2x the highest frequency component fmax in the signal; fs >= 2 x fmax is the Nyquist criterion
  • Aliasing: The distortion that occurs when a signal is sampled below the Nyquist rate; high-frequency components above fs/2 fold back into the spectrum and appear as false low-frequency components that do not exist in the original signal
  • Nyquist Frequency: The maximum frequency that can be represented without aliasing at a given sampling rate; equal to fs/2; signals at exactly the Nyquist frequency are ambiguously represented and may appear at any frequency from 0 to fs/2
  • Anti-Aliasing Filter: A low-pass filter applied before the ADC to attenuate signal components above the Nyquist frequency before sampling; prevents aliased components from entering the digital data; cutoff frequency is typically set to 0.4 x fs or below
  • Oversampling: Sampling at a rate significantly above the Nyquist minimum; spreads quantization noise over a wider frequency band, allowing it to be filtered out; oversampling by 4x and decimating effectively adds 1 bit of resolution
  • Sample-and-Hold Circuit: The analog input circuit that captures (samples) the input voltage at a precise instant and holds it stable during the ADC conversion period; settling time of the S/H circuit limits the maximum usable sampling rate
  • Quantization Noise: The error introduced by representing a continuous voltage as one of 2^N discrete levels; quantization noise is approximately white noise with amplitude +-0.5 LSB; SNR improvement = 6.02 dB per additional bit of resolution
  • Signal Reconstruction: Recovering the original continuous signal from discrete samples using an ideal reconstruction (sinc interpolation) or practical low-pass filter; the reconstructed signal is an accurate replica of the original only if the Nyquist criterion was satisfied during sampling

28.5 Learning Objectives

By the end of this section, you will be able to:

  • Apply Nyquist Theorem: Calculate minimum sampling rates for different signals
  • Diagnose Aliasing: Explain why undersampling causes incorrect frequency representation and predict aliased frequencies
  • Design Anti-Aliasing Filters: Specify hardware low-pass filter parameters to prevent high-frequency contamination before ADC
  • Evaluate Sampling-Power Trade-offs: Select optimal sampling rates that satisfy Nyquist while minimizing energy consumption in battery-powered IoT devices
  • Implement Oversampling: Use extra samples to improve effective resolution and reduce anti-aliasing filter complexity

Imagine trying to draw a smooth wave by only placing a dot every few seconds — if you place dots too infrequently, you get a distorted picture that looks nothing like the original wave. Sampling theory tells us exactly how often we need to measure a changing signal to capture it faithfully. The key rule is simple: sample at least twice as fast as the signal changes. This concept applies every time a sensor reads the physical world.

28.6 Prerequisites

Before diving into this chapter, you should be familiar with:

  • ADC Fundamentals: Understanding how ADCs convert analog to digital
  • Binary Fundamentals: Understanding of resolution and bit depth
  • Basic Signal Concepts: Understanding of frequency (Hz) and waveforms

28.7 Why This Chapter Matters

Follow these connections in order: Sampling theory sounds mathematical, but it answers a brutally practical question: how often do I need to read a sensor so the data still represents reality. In real IoT systems, bad sampling choices create fake signals, missed events, wasted battery, and misleading analytics. The device may still produce numbers, but the numbers no longer describe the real world. This chapter gives students a way to choose sampling rates intentionally instead of guessing.

28.8 How To Use This Chapter

  • Start with the Nyquist rule and the aliasing examples. Those are the ideas you must keep.
  • Read the tables with real signal types slowly and compare them to devices you already know: temperature sensors, microphones, ECG signals, accelerometers, and vibration monitors.
  • When you finish a section, ask yourself what would happen in a real product if the sampling rate were cut in half.
Chapter Roadmap
  • Start Simple
  • In 60 Seconds
  • Key Concepts
  • For Beginners: Sampling Theory
  • Prerequisites
  • Why This Chapter Matters
  • How To Use This Chapter
  • Nyquist-Shannon Sampling Theorem
  • Phoebe’s Field Notes: Why Aliases Fold Back
  • Deep dive: Putting Numbers to It
  • Practical Sampling Rate Examples
  • Checkpoint: Rate Selection
  • Understanding Aliasing
  • Vibration Monitor Check
  • Sampling Tradeoffs for Vibration
  • Sampling Rate vs Power Consumption
  • Sampling Rate vs Power
  • Checkpoint: Aliasing and Power
  • Anti-Aliasing Filters
  • Anti-Aliasing Filter Strategies
  • RC Anti-Aliasing Calculator
  • ADC Sampling and Aliasing Demo
  • Sampling Rate Design Calculator
  • Nyquist Rate Calculator
  • Checkpoint: Filters and Calculators

28.9 Nyquist-Shannon Sampling Theorem

The first design question is simple: what is the fastest part of the signal you must preserve. Nyquist turns that question into the minimum sampling rate.

To accurately digitize an analog signal, you must sample at least TWICE the highest frequency component.

fsample2×fmaxf_{sample} \geq 2 \times f_{max}

The mathematical gist. Sampling at fsf_s gives a Nyquist ceiling fs/2f_s/2. A band ending at fmaxf_{max} stays distinct only when fs2fmaxf_s\geq2f_{max}; otherwise a tone folds to fsignalnfs|f_{signal}-nf_s|. Thus the chapter’s 800 Hz harmonic sampled at 1000 Hz appears falsely at 200 Hz, while 2500 Hz covers the named 1 kHz precursor with a 1250 Hz Nyquist ceiling.

Math Bridge · guided foundationsWhy can an 800 Hz vibration masquerade as 200 Hz?Let Eddie connect sample rate, Nyquist ceiling, and alias folding.

For audio sampling human voice (max frequency fmax=3400f_{max} = 3400 Hz), Nyquist requires fsample2×3400=6800f_{sample} \geq 2 \times 3400 = 6800 Hz minimum. Telephony uses 8 kHz (18% margin). For music (fmax=20f_{max} = 20 kHz), CD audio samples at 44.144.1 kHz = 2.205×fmax2.205 \times f_{max}, providing a 10% guard band for the anti-aliasing filter’s roll-off. If you undersample a 1 kHz tone at 1.5 kHz (below Nyquist 2 kHz), it aliases to 10001500=500|1000 - 1500| = 500 Hz — you hear the wrong pitch. Power cost: sampling at 10 kHz vs 1 kHz increases ADC energy significantly (ESP32: ~2mA base + ~0.001mA per sample/s).

Inspect Figure 28.1 at this point because its depiction of nyquist-Shannon sampling theorem summary supplies the physical context for the prose.

Diagram summarizing the Nyquist-Shannon sampling theorem with the period and frequency conditions for reliable digital sampling
Figure 28.1: Nyquist-Shannon sampling theorem summary

Figure 28.1 gives separate roles to Nyquist-Shannon Sampling Theorem, pn = period of the “fastest” sine wave, and fn = frequency of the “fastest” sine wave. Following those roles reveals nyquist-Shannon sampling theorem summary. That reading provides the evidence needed for the section’s next calculation, comparison, or field check.

For verification, record the fastest sine-wave period pn, derive fn = 1/pn, and compare the sampling interval with half that period.

The theorem has direct implications for how we choose sampling rates in practice. Bare Nyquist is the mathematical minimum, but real devices usually need extra margin for noise, timing uncertainty, and anti-aliasing filter roll-off.

Trace Figure 28.2 before continuing. It turns how sample rate changes the reconstructed signal from a verbal claim into labelled evidence.

Three-step comparison showing undersampling, the bare Nyquist minimum, and practical oversampling, with the reconstructed waveform becoming more faithful as sample rate increases
Figure 28.2: How sample rate changes the reconstructed signal

Figure 28.2 gives separate roles to How Sample Rate Changes, Teal is the true signal, dots are the samples,, and 1. Undersampling. Following those roles reveals how sample rate changes the reconstructed signal. That reading provides the evidence needed for the section’s next calculation, comparison, or field check.

28.9.1 Why This Matters

Undersampling (too slow) causes aliasing - high frequencies appear as low frequencies!

Inspect Figure 28.3 before why this matters; its labelled elements make aliasing in a real sampling scenario concrete enough to test against the circuit narrative.

A real 50 Hz signal aliases to 30 Hz when sampled at 80 Hz. Sampling at 500 Hz with an anti-alias filter reconstructs it; digital filtering cannot undo ADC aliasing.
Figure 28.3: Aliasing in a real sampling scenario

Anchor Figure 28.3 on True waveform: period = 20 ms, which corresponds to the stated Shaft speed = 3000 RPM. Under Signal Aliasing and Sampling, compare that real motion with the more slowly changing sample sequence. The mismatch shows how sparse observations can imply a false shaft speed or direction, connecting the sampling theorem to a concrete monitoring failure rather than an abstract waveform exercise.


28.10 Practical Sampling Rate Examples

Signal TypeFrequencyMinimum Sample RateTypical RateReason
Temperature~0.01 Hz (slow)0.02 Hz1 HzChanges very slowly
Audio (human voice)300-3,400 Hz6,800 Hz8,000 HzPhone quality
Audio (music)20-20,000 Hz40,000 Hz44,100 HzCD quality
ECG (heart)0.5-100 Hz200 Hz250-500 HzMedical-grade clarity
Vibration10-1,000 Hz2,000 Hz5,000-10,000 HzSafety margin for harmonics
Accelerometer (gesture)50 Hz100 Hz200 HzOversampling for noise

Arduino Uno ADC:

Compare the examples by moving from the stated input to the resulting electrical behavior: Maximum sample rate: ~9,600 Hz (9.6 kHz). Practical rate: ~1-5 kHz for stable readings.

ESP32 ADC:

Compare the examples by moving from the stated input to the resulting electrical behavior: Maximum sample rate: ~83 kHz. Practical audio sampling: 16-48 kHz.

Voltage VeraCheckpoint: Rate Selection

You now know:

  • A 500 Hz signal needs at least 1000 Hz sampling.
  • A 500 Hz vibration design usually uses 1250-2500 Hz instead of the bare minimum.
  • A 3400 Hz voice band needs at least 6800 Hz; telephony uses 8 kHz.


28.11 Understanding Aliasing

Meeting the minimum is only half the story. Out-of-band frequencies can still make sampled data look clean but wrong.

Real-World Scenario:

You’re designing a predictive maintenance system for a manufacturing plant. The system monitors motor vibrations to detect bearing failures before catastrophic breakdown. Motors typically vibrate at:

  • Normal operation: 0-200 Hz (fundamental frequency + harmonics)
  • Bearing defect signature: 500 Hz peak
  • Critical failure precursor: High-frequency components up to 1 kHz

Your ESP32-based vibration sensor uses an accelerometer with analog output. You need to decide the ADC sampling rate.

Customer Requirements:

  1. Detect 500 Hz bearing defect signals reliably
  2. Minimize false alarms from aliasing artifacts
  3. Battery-powered operation (sampling consumes power)
  4. Real-time processing on ESP32 (limited RAM for buffering)

Engineering proposes three options:

  • Option A: Sample at 500 Hz (same as defect frequency)
  • Option B: Sample at 1000 Hz (2x defect frequency, Nyquist minimum)
  • Option C: Sample at 2500 Hz (5x defect frequency, oversampling)

Analysis:

Sampling Tradeoffs for Vibration

Option A: 500 Hz Sampling (FAILS)

  • Nyquist minimum for 500 Hz signal: 2 x 500 Hz = 1000 Hz
  • Sampling at 500 Hz = exactly at signal frequency → aliasing occurs!
  • Aliasing: Nyquist frequency is only 250 Hz, so the 500 Hz component folds back to |500 - 500| = 0 Hz (DC) or nearby low frequencies depending on phase
  • Result: Cannot detect bearing defects reliably → UNACCEPTABLE for safety-critical application

Option B: 1000 Hz Sampling (RISKY)

  • Meets Nyquist minimum (1000 Hz >= 2 x 500 Hz)
  • But: Real motors have frequency components >500 Hz (harmonics, noise)
  • If motor has 800 Hz component (unfiltered), aliasing occurs:
    • Aliased frequency = |800 Hz - 1000 Hz| = 200 Hz (false low-frequency artifact)
    • Appears as normal vibration, masking actual bearing defect
  • Problem: No margin for real-world signal complexity

Option C: 2500 Hz Sampling (RECOMMENDED)

  • 5x oversampling provides safety margin
  • Allows for anti-aliasing filter with gradual roll-off
  • Captures harmonics up to 1.25 kHz
  • Power Cost: 2.5x higher than Option B (ESP32: ~3mA @ 1 kHz → ~4.5mA @ 2.5 kHz)
  • Benefit: Reliable defect detection, worth the power trade-off for predictive maintenance

Aliasing Example - Why Undersampling Fails:

Sampling 2 kHz signal at 3 kHz (below Nyquist 4 kHz):

  • Nyquist minimum: 2 x 2 kHz = 4 kHz
  • Actual sampling: 3 kHz < 4 kHz → aliasing!
  • Aliased frequency: |2 kHz - 3 kHz| = 1 kHz
  • Critical failure: 2 kHz bearing defect appears as harmless 1 kHz vibration
  • Maintenance team ignores “false” 1 kHz signal → bearing fails → $500K production downtime

28.12 Sampling Rate vs Power Consumption

Once the signal is sampled honestly, every extra sample must justify its current, storage, and transmission cost.

Sampling Rate vs Power

Option A: High-frequency sampling (1000 Hz): Captures fast transients, supports 500 Hz signal bandwidth, power draw ~5mW continuous (ESP32 ADC at 1kHz), generates 86.4 million samples/day, requires 345 MB/day storage at 32-bit

Option B: Low-frequency sampling (1 Hz): Adequate for slow environmental signals (temperature, humidity), power draw ~0.005mW with sleep between samples, generates 86,400 samples/day, requires 345 kB/day storage

Decision Factors: For battery-powered environmental sensors where signals change over minutes/hours, 1 Hz sampling extends battery life 1000x while capturing all meaningful variation. For vibration analysis, motor monitoring, or audio capture, 1000+ Hz is mandatory to avoid aliasing. A smart approach uses adaptive sampling: high rate during detected events, low rate during quiet periods.

Power vs Sampling Rate:

  • ESP32 ADC power: ~2mA base + 0.001mA per sample/sec
  • @ 100 Hz: 2.1mA
  • @ 1 kHz: 3mA
  • @ 10 kHz: 12mA
  • For battery-powered devices: Sample only as fast as needed!
Voltage VeraCheckpoint: Aliasing and Power

You now know:

  • Sampling 500 Hz at 500 Hz fails: the Nyquist frequency is only 250 Hz, and the defect can fold to 0 Hz.
  • A 1000 Hz design has no margin for an 800 Hz harmonic, which can appear as 200 Hz.
  • Cost scales quickly: 1 Hz creates 86,400 samples/day and about 345 kB/day; 1000 Hz creates 86.4 million samples/day and about 345 MB/day.

28.13 Anti-Aliasing Filters

Problem: Real-world signals have infinite frequency components (noise, harmonics). How to ensure f_max before ADC?

Solution: Hardware Anti-Aliasing Filter

  • Passive RC low-pass filter:

    • R = 10k ohm, C = 1uF → f_cutoff = 15.9 Hz
    • Blocks frequencies >50 Hz before ADC sampling at 100 Hz
    • Cost: $0.15 (resistor + capacitor)
  • Active Sallen-Key filter:

    • Op-amp based, sharp roll-off
    • 4th-order Butterworth: -80 dB/decade above cutoff
    • Cost: $1-2 (op-amp + passives)

Best Practice:

  1. Add hardware filter with f_cutoff = f_sample / 4
  2. Sample at 2.5-5x desired f_max
  3. Apply digital low-pass filter in software for extra margin

Example: 500 Hz vibration monitoring

  • Hardware filter: f_cutoff = 600 Hz (Sallen-Key 4th-order)
  • ADC sampling: 2500 Hz (5x oversampling)
  • Digital filter: 500 Hz FIR low-pass
  • Result: Aliasing risk <0.01%, reliable defect detection

Anti-Aliasing Filter Design Rule:

Before the ADC, use a low-pass filter to attenuate frequencies above the Nyquist frequency (fsample/2f_{sample}/2). In practice, set the filter cutoff below Nyquist to allow for the filter’s gradual roll-off:

fcutofffsample2f_{cutoff} \leq \frac{f_{sample}}{2}

A common practical guideline is fcutoff=fsample/4f_{cutoff} = f_{sample}/4, which provides sufficient transition bandwidth for the filter to reach adequate attenuation by fsample/2f_{sample}/2.

Why? If high-frequency noise (>f_sample/2) reaches the ADC, it aliases to lower frequencies, corrupting data.

Design a passive RC low-pass filter for anti-aliasing. Enter the desired cutoff frequency or component values to calculate the filter response.

Example: 1 kHz accelerometer sampling without anti-aliasing filter

  • Motor emits 1.2 kHz vibration harmonic
  • Nyquist frequency: 1000 Hz / 2 = 500 Hz
  • 1.2 kHz signal aliases to: |1200 Hz - 1000 Hz| = 200 Hz
  • False reading: 200 Hz vibration appears in data (doesn’t exist!)
  • Solution: Add RC low-pass filter with f_c = 400 Hz before ADC

28.14 ADC Sampling and Aliasing Demo

ADC Sampling and Aliasing Demo

Experiment with ADC sampling concepts: adjust signal frequency, sampling rate, and ADC resolution to see how they affect signal reconstruction and observe aliasing when the Nyquist criterion is violated.

Interactive element unavailable — chart cell

d3: d3 (charting library) is not bundled; only d3.sum and d3.range calculator helpers are available (unsupported d3 API(s): d3.create, d3.scaleLinear, d3.axisBottom, d3.axisLeft, d3.line)

Show source


// Waveform visualization
{
const width = 700;
const height = 250;
const margin = {top: 20, right: 20, bottom: 35, left: 50};
const plotW = width - margin.left - margin.right;
const plotH = height - margin.top - margin.bottom;

// Time span: show 2-3 full cycles of the signal
const cycles = 3;
const duration = cycles / signalFrequency;
const numPoints = 500;

// Generate continuous signal
const continuous = Array.from({length: numPoints}, (_, i) => {
const t = (i / (numPoints - 1)) * duration;
return {t, v: signalAmplitude * Math.sin(2 * Math.PI * signalFrequency * t)};
});

// Generate sample points
const sampleInterval = 1 / samplingRate;
const numSamples = Math.floor(duration / sampleInterval) + 1;
const samples = Array.from({length: numSamples}, (_, i) => {
const t = i * sampleInterval;
const v = signalAmplitude * Math.sin(2 * Math.PI * signalFrequency * t);
// Quantize
const levels = Math.pow(2, adcBits);
const step = (2 * signalAmplitude) / levels;
const quantized = Math.round((v + signalAmplitude) / step) * step - signalAmplitude;
return {t, v: quantized};
});

// Generate aliased (reconstructed) waveform if aliasing
const aliased = isAliasing ? Array.from({length: numPoints}, (_, i) => {
const t = (i / (numPoints - 1)) * duration;
return {t, v: signalAmplitude * Math.sin(2 * Math.PI * aliasedFrequency * t)};
}) : null;

const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("width", "100%")
.style("max-width", width + "px")
.style("background", "#fafafa")
.style("border-radius", "8px");

const xScale = d3.scaleLinear().domain([0, duration]).range([0, plotW]);
const yScale = d3.scaleLinear().domain([-1.1 * signalAmplitude, 1.1 * signalAmplitude]).range([plotH, 0]);

const g = svg.append("g").attr("transform", `translate(${margin.left},${margin.top})`);

// Axes
g.append("g").attr("transform", `translate(0,${plotH})`).call(d3.axisBottom(xScale).ticks(6).tickFormat(d => (d * 1000).toFixed(1) + " ms"));
g.append("g").call(d3.axisLeft(yScale).ticks(5).tickFormat(d => d.toFixed(1) + " V"));

// Original signal (blue, thin)
const line = d3.line().x(d => xScale(d.t)).y(d => yScale(d.v));
g.append("path").datum(continuous).attr("d", line).attr("fill", "none").attr("stroke", "#3498DB").attr("stroke-width", 1.5).attr("opacity", 0.6);

// Aliased reconstruction (red dashed) if aliasing
if (aliased) {
g.append("path").datum(aliased).attr("d", line).attr("fill", "none").attr("stroke", "#9b1c1c").attr("stroke-width", 2).attr("stroke-dasharray", "6,3");
}

// Reconstructed from samples (green line connecting sample points)
const sampleLine = d3.line().x(d => xScale(d.t)).y(d => yScale(d.v));
g.append("path").datum(samples).attr("d", sampleLine).attr("fill", "none").attr("stroke", "#0b6b50").attr("stroke-width", 1).attr("opacity", 0.5);

// Sample points (orange dots)
g.selectAll("circle").data(samples).join("circle")
.attr("cx", d => xScale(d.t)).attr("cy", d => yScale(d.v))
.attr("r", 3.5).attr("fill", "#E67E22").attr("stroke", "#2C3E50").attr("stroke-width", 0.5);

// Legend
const legend = g.append("g").attr("transform", `translate(${plotW - 200}, 5)`);
legend.append("line").attr("x1", 0).attr("x2", 20).attr("y1", 0).attr("y2", 0).attr("stroke", "#3498DB").attr("stroke-width", 1.5).attr("opacity", 0.6);
legend.append("text").attr("x", 25).attr("y", 4).text("Original signal").attr("font-size", "10px").attr("fill", "#2C3E50");
legend.append("circle").attr("cx", 10).attr("cy", 15).attr("r", 3).attr("fill", "#E67E22");
legend.append("text").attr("x", 25).attr("y", 19).text("ADC samples").attr("font-size", "10px").attr("fill", "#2C3E50");
if (isAliasing) {
legend.append("line").attr("x1", 0).attr("x2", 20).attr("y1", 30).attr("y2", 30).attr("stroke", "#9b1c1c").attr("stroke-width", 2).attr("stroke-dasharray", "6,3");
legend.append("text").attr("x", 25).attr("y", 34).text("Aliased (" + aliasedFrequency.toFixed(1) + " Hz)").attr("font-size", "10px").attr("fill", "#9b1c1c");
}

return svg.node();
}

How to Use This Demo:

  1. Start with defaults (10 Hz signal, 100 Hz sampling) - observe clean sampling
  2. Increase signal frequency past 50 Hz (half of sampling rate) to see aliasing occur
  3. Watch the aliased frequency - a 60 Hz signal sampled at 100 Hz appears as 40 Hz!
  4. Increase sampling rate to eliminate aliasing
  5. Change ADC resolution to see how quantization levels affect the sampled values

Key Observations:

  • Nyquist Rule: When signal frequency > sampling rate / 2, aliasing occurs
  • Aliased Frequency: The signal “folds back” into the [0, fs/2] range
  • Quantization: Higher bit resolution = more voltage levels = finer measurements
  • Status Indicators: The dashboard above turns red when the Nyquist criterion is violated

Try These Experiments:

ExperimentSettingsWhat to Observe
Nyquist Limitf=49 Hz, fs=100 HzJust under limit - OK
Aliasingf=60 Hz, fs=100 Hz60 Hz appears as 40 Hz
Severe Aliasingf=90 Hz, fs=100 Hz90 Hz appears as 10 Hz
More Samplesf=20 Hz, fs=200 HzClean reconstruction
Low ResolutionAny, 8-bitVisible quantization steps
High ResolutionAny, 12-bitSmoother quantization

28.15 Sampling Rate Design Calculator

Use this calculator to determine the required sampling rate, storage needs, and estimated power draw for your IoT sensor design. Enter your signal parameters and the calculator will apply the Nyquist theorem with practical engineering margins.

How to use: Enter your signal’s highest frequency component, pick an oversampling factor appropriate for your application (2.5x for general IoT, 5x for industrial/safety, 10x for medical), then set your ADC resolution, recording duration, and channel count. The calculator outputs the Nyquist minimum, practical recommended rate, required anti-aliasing filter cutoff, storage budget, data throughput rate, and estimated ESP32 ADC current draw.

Voltage VeraCheckpoint: Filters and Calculators

You now know:

  • At 1 kHz sampling, a 1.2 kHz vibration harmonic can fold into a false 200 Hz reading.
  • A 500 Hz vibration monitor can sample at 2500 Hz, use a 600 Hz hardware filter, and apply a 500 Hz digital filter.
  • A first-order RC filter rolls off at -20 dB/decade; a 2nd-order Sallen-Key filter gives -40 dB/decade.


28.16 Continue to the Next Part

Carry this evidence into Sampling Design: Product Scenarios, which begins with For Kids: Meet the Sensor Squad!.