Mathematical Rules of Thumb, illustrated reader · Chapter 24

24Signal Processing

Sampling, Resolution, and Spectral Judgment

4 demonstrations follow the chapter's rules. Choose a value, watch the figure and the numbers change, and check your prediction. Every choice is precomputed from the notebook calculations.

Ask the chapter skill

“Help me use Chapter 24 for my question. Choose a rule, check its assumptions, and show how the result changes when an input changes.”

Use math-thumb-signal-processing from the companion's skill package. The demonstrations below also work on their own.

Examples use constructed inputs or the book's own values, disclosed in each panel. A picture illustrates a rule; its assumptions set its scope.

1Demonstration 1 of 4

Create an alias by sampling above Nyquist

Where does a 600Hz sine appear at this sample rate?

Generate a sinusoid, sample it, and execute its FFT. The observed peak exposes aliasing.

falias=|((f+fs/2)mod⁡fs)−fs/2| f_{alias}=\left|((f+f_s/2)\bmod f_s)-f_s/2\right|

Input sinusoid frequency (Hz). fs=1000Hz, 1000 samples; coherent synthetic sine. Real acquisitions need an analog anti-alias filter.

Predict first. Where does a 600Hz sine appear at this sample rate?

Choose an example

Create an alias by sampling above Nyquist. A constructed 400 Hz sine sampled at 1000 Hz produces a peak at 400 Hz. 400 Hz is below the 500 Hz Nyquist limit (half the sample rate), so it appears where it belongs.
Input sinusoid frequency (Hz): 400
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Sample rate (Hz)
1000
Input frequency (Hz)
400
Measured sampled peak (Hz)
400
Aliased frequency (Hz)
400

A constructed 400 Hz sine sampled at 1000 Hz produces a peak at 400 Hz. 400 Hz is below the 500 Hz Nyquist limit (half the sample rate), so it appears where it belongs.

Use the idea

Use rule 24.1.1 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

fs=1000Hz, 1000 samples; coherent synthetic sine. Real acquisitions need an analog anti-alias filter.

Check your understanding: Where does a 600Hz sine appear at this sample rate?
At 400Hz. The sampled data cannot distinguish those frequencies without additional information.

Book source: Rule 24.1.1: Sample above twice the highest frequency with a guard band. Demonstration C24-D01. Worked illustration.

2Demonstration 2 of 4

Compare longer acquisition with zero padding

Does an eightfold padded transform provide eight times the acquired information?

Actually transform two nearby tones with a Hann window and eightfold padding. A longer record narrows the main lobes until the peaks land on the true tones; padding only fills their display grid.

Δfgrid=fs/NFFT,duration scale=1/T \Delta f_{grid}=f_s/N_{FFT},\quad\text{duration scale}=1/T

Acquired duration T (s). fs=1000Hz, tones 100 and 100.2Hz, fixed phases. Resolution depends on the window and criterion; 1/T is a scale.

Predict first. Does an eightfold padded transform provide eight times the acquired information?

Choose an example

Compare longer acquisition with zero padding. The 20-second record contains tones at 100 and 100.2 Hz (dotted lines). The main lobes are now narrow enough that the peaks land on the true tone frequencies. Zero padding only refines the plotted grid; duration and window govern resolution.
Acquired duration T (s): 20
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Duration (s)
20
Hann main-lobe half-width 2/T (Hz)
0.1
Padded bin spacing (Hz)
0.00625
Tone separation (Hz)
0.2
Spectral peaks found (Hz)
100, 100.2

The 20-second record contains tones at 100 and 100.2 Hz (dotted lines). The main lobes are now narrow enough that the peaks land on the true tone frequencies. Zero padding only refines the plotted grid; duration and window govern resolution.

Use the idea

Use rule 24.2.2 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

fs=1000Hz, tones 100 and 100.2Hz, fixed phases. Resolution depends on the window and criterion; 1/T is a scale.

Check your understanding: Does an eightfold padded transform provide eight times the acquired information?
No. It interpolates the spectrum of the same acquired samples.

Book source: Rule 24.2.2: Use zero padding for spectral interpolation, not added resolution. Demonstration C24-D02. Worked illustration.

3Demonstration 3 of 4

Expose leakage and the window tradeoff

Does a lower sidelobe window improve every kind of spectral resolution?

Transform a noncoherent tone and compare sidelobes with main-lobe width.

Xw[k]=∑n=0N−1w[n]x[n]e−2πikn/N X_w[k]=\sum_{n=0}^{N-1}w[n]x[n]e^{-2\pi i kn/N}

Window. 256 samples at 1000Hz, 103.3Hz sine, coherent-gain normalization; padding interpolates the display.

Predict first. Does a lower sidelobe window improve every kind of spectral resolution?

Choose an example

Expose leakage and the window tradeoff. The Hann window drops leakage twenty hertz away to about −49 dB, but its central peak is twice as wide. The tone is not coherent with the 256-sample record. A Hann window reduces distant leakage while widening its main lobe. Dividing by the window sum corrects coherent gain; it does not remove every off-bin amplitude bias.
Window: Hann
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Window
Hann
Samples
256
Tone (Hz)
103.3
Window average (amplitude correction)
0.498047

The Hann window drops leakage twenty hertz away to about −49 dB, but its central peak is twice as wide. The tone is not coherent with the 256-sample record. A Hann window reduces distant leakage while widening its main lobe. Dividing by the window sum corrects coherent gain; it does not remove every off-bin amplitude bias.

Use the idea

Use rule 24.2.1 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

256 samples at 1000Hz, 103.3Hz sine, coherent-gain normalization; padding interpolates the display.

Check your understanding: Does a lower sidelobe window improve every kind of spectral resolution?
No. Lower sidelobes often come with a broader main lobe, changing the tradeoff between nearby strong and weak tones.

Book source: Rule 24.2.1: Window noncoherent records before spectral measurement. Demonstration C24-D03. Worked illustration.

4Demonstration 4 of 4

Filter before throwing samples away

At M=3, where does the 380 Hz tone appear without a filter?

Keep every Mth sample of a 50 Hz plus 380 Hz signal, with and without a low-pass filter first.

fsnew=fs/M,keep content below fs/(2M) f_s^{new}=f_s/M,\quad\text{keep content below }f_s/(2M)

Downsampling factor M. fs=1000 Hz, 3 s record, unit-amplitude tones, Hann-windowed sinc low-pass at 80% of the new Nyquist.

Predict first. At M=3, where does the 380 Hz tone appear without a filter?

Choose an example

Filter before throwing samples away. The new Nyquist limit is 250 Hz, below the 380 Hz tone. Without a filter that tone folds down to a fake 120 Hz peak that looks just like a real signal. Filtering first removes it, leaving only the true 50 Hz. Once aliasing happens, no later processing can undo it.
Downsampling factor M: 2
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Downsampling factor
2
New sample rate (Hz)
500
New Nyquist (Hz)
250
380 Hz tone appears at (Hz)
120

The new Nyquist limit is 250 Hz, below the 380 Hz tone. Without a filter that tone folds down to a fake 120 Hz peak that looks just like a real signal. Filtering first removes it, leaving only the true 50 Hz. Once aliasing happens, no later processing can undo it.

Use the idea

Use rule 24.1.2 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

fs=1000 Hz, 3 s record, unit-amplitude tones, Hann-windowed sinc low-pass at 80% of the new Nyquist.

Check your understanding: At M=3, where does the 380 Hz tone appear without a filter?
At 46.7 Hz, right beside the real 50 Hz tone. Filtering first removes it.

Book source: Rule 24.1.2: Low-pass before every downsampling step. Demonstration C24-D04. Worked illustration.

Bring the idea to a question of your own

Choose the relationship that answers your question, check its conditions, and compare the result with the accuracy or decision threshold you need.

The chapter skill can adapt these calculations to your inputs. It should name the assumptions, explain what the result supports, and say what still needs evidence. The chapter workbook adds a lab and three exercises with answers.