Nyquist-Shannon Sampling Theorem
Understand sampling requirements, aliasing, and the Nyquist rate for digital signal processing
Try these examples:
Nyquist-Shannon Sampling Theorem
To accurately reconstruct a signal, the sampling rate must be at least twice the highest frequency present. This principle governs all digital signal processing.
Signal and Sampling Parameters
Signal frequency :
Sampling rate :
The Nyquist Criterion
For maximum frequency the Nyquist rate is:
Your signal at
Properly sampled -- no aliasing will occur.
Frequency Folding (apparent frequency after sampling)
Sampling at cannot tell a frequency from , , and so on, so every true frequency is seen somewhere between 0 and . Up to =
What the Samples See
The Samples and the Wave They Fit
The stems are the samples, one every seconds, taken from the grey wave. No slower wave fits these samples, so the signal can be rebuilt from them. Slide
| Metric | Value |
|---|---|
| Nyquist rate | |
| Samples per period | |
| Aliased frequency |
Aliasing
When , high frequencies fold back as lower frequencies. The aliased frequency is:
where places in .
Waveform Resolution
With
Good resolution -- waveform shape is recognizable.
Even above the Nyquist rate, more samples per period improve reconstruction. Most practical systems oversample at to the Nyquist rate. Try dragging =
Reconstruction
A band-limited signal with for can be perfectly recovered from its samples when :
Before sampling, an anti-aliasing filter removes frequencies above . After reconstruction, the formula above fills in the gaps -- but only if the Nyquist criterion is met. Drag
Try it in Code
f_sig = 1000 # Signal frequency (Hz)
f_s = 8000 # Sampling rate (Hz)
nyquist_rate = 2 * f_sig
samples_per_period = f_s / f_sig
# Aliased frequency when undersampled
if f_s < nyquist_rate:
k = round(f_sig / f_s)
f_alias = abs(f_sig - k * f_s)
else:
f_alias = f_sig
print(f"Nyquist rate: {nyquist_rate} Hz")
print(f"Samples per period: {samples_per_period:.2f}")
print(f"Status: {'Properly sampled' if f_s >= nyquist_rate else 'ALIASED'}")
print(f"Apparent frequency: {f_alias} Hz")What to explore next
Structural Beam Analysis
Analyze simply supported beams using static equilibrium principles
Beam Deflection Analysis
Visualize how beams bend under load and explore the relationship between material properties, geometry, and deflection
Circuit Analysis Explorer
Master series, parallel, and combination circuits with interactive visualizations of Ohm's Law, Kirchhoff's laws, and power dissipation
RC Filter Design
Design low-pass and high-pass filters using resistance-capacitance circuits
You might also like
Beam Deflection Analysis
ExplorationVisualize how beams bend under load and explore the relationship between material properties, geometry, and deflection
Beam Deflection Calculator
Calculate maximum deflection and reaction forces for common beam loading conditions - simply supported and cantilever beams with point or distributed loads
Bernoulli Equation Calculator
Apply Bernoulli's principle to relate pressure, velocity, and height at two points in a steady, incompressible fluid flow along a streamline
Circuit Analysis Explorer
ExplorationMaster series, parallel, and combination circuits with interactive visualizations of Ohm's Law, Kirchhoff's laws, and power dissipation