/signal-processing:dsp-sampling-frequency-domain-and-filtersfrom signal-processing
Covers sampling theory (Nyquist-Shannon), aliasing, quantization, dither, frequency-domain transforms (DFT, FFT, STFT), windowing, spectral leakage, time-frequency uncertainty, and FIR vs IIR filter design. Part of a signal-processing reference series.
Ships in signal-processing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 1 of 5 of the Signal Processing reference (plugin
signal-processing), covering §0–§3. Sibling skills:dsp-convolution-multirate-and-spectral-analysis(§4–§7),dsp-audio-rf-and-images(§8–§10),dsp-implementation-tools-and-testing(§11–§14),dsp-reference(§15–§20). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Verified August 2026. See §17 →
dsp-referencefor the currency snapshot and what goes stale first.
How to read this. Reference for engineers who need DSP working, not a course. Three markers:
- [DURABLE] — sampling theory, transforms, filters, estimation. Nyquist is 1928; Shannon 1949; the Cooley–Tukey FFT 1965. This material does not expire.
- [VERSIONED] — codecs, libraries, hardware, the ML layer.
- [CONTESTED] — genuine disagreement.
⚠️ GOTCHA boxes mark where the code runs, the plot looks fine, and the answer is wrong.
The three framings that organize everything below:
- Everything is a trade between time and frequency resolution, and you cannot cheat it. The uncertainty principle is not a metaphor here — a short window gives you good time resolution and poor frequency resolution, and no amount of cleverness escapes that (§2.4). Most DSP design is choosing where on that curve to sit.
- ⚠️ Aliasing is irreversible. Once you've sampled too slowly, the information is gone — no filter, no algorithm, and no neural network recovers it. This is the one mistake in this document that cannot be fixed downstream (§1).
- The field is mid-convergence with machine learning, and the interesting result is that hybrids are winning — not pure DSP, and not pure end-to-end learning. ⚠️ The pattern that keeps recurring: use DSP for the structure you know, and learn the parameters you can't hand-tune (§8 →
dsp-audio-rf-and-images, §16.1 →dsp-reference).
| Asked about... | Go to |
|---|---|
| Sampling, aliasing, quantization | §1 |
| The frequency domain, FFT, windowing | §2 |
| Filters — design and choice | §3 |
| Convolution and correlation | §4 → dsp-convolution-multirate-and-spectral-analysis |
| Multirate: resampling, decimation | §5 → dsp-convolution-multirate-and-spectral-analysis |
| Adaptive filtering and estimation | §6 → dsp-convolution-multirate-and-spectral-analysis |
| Spectral analysis and time-frequency | §7 → dsp-convolution-multirate-and-spectral-analysis |
| Audio and speech | §8 → dsp-audio-rf-and-images |
| RF and communications | §9 → dsp-audio-rf-and-images |
| Images and video | §10 → dsp-audio-rf-and-images |
| Implementation: fixed point, real-time | §11 → dsp-implementation-tools-and-testing |
| Tools and libraries | §12 → dsp-implementation-tools-and-testing |
| Testing and debugging DSP | §13 → dsp-implementation-tools-and-testing |
| Sensors and physical signals | §14 → dsp-implementation-tools-and-testing |
| "Don't do this" | §15 → dsp-reference |
| "Which side is right?" | §16 → dsp-reference |
| "Is this still current?" | §17 → dsp-reference |
| Books and people | §18 → dsp-reference |
[DURABLE] The foundation, and the source of the most expensive mistakes.
**A signal band-limited to B Hz is perfectly reconstructable from samples taken at
2B Hz.** ⚠️ Note the strictness: strictly greater than, and strictly band-limited.
⚠️ GOTCHA — aliasing, and why it's the worst bug in this document. Frequency components above Nyquist do not disappear — they fold back and appear as lower frequencies that are indistinguishable from real signal. A 30 kHz tone sampled at 44.1 kHz appears at 14.1 kHz. It looks like data. It is not.
⚠️ The fix must happen in the analog domain, before the ADC. An anti-aliasing filter is a hardware component. Once aliased, always aliased — there is no software repair, and this is the single most important operational fact in DSP.
The same applies when you downsample in software (§5 →
dsp-convolution-multirate-and-spectral-analysis): ⚠️ decimating without low-pass filtering first is aliasing you inflicted on yourself.
⚠️ And the corollaries people miss: sampling a signal that isn't band-limited (virtually everything real) aliases the noise floor too; sampling exactly at 2B is not enough (a sine sampled at its zero crossings gives you nothing); and jitter in the sample clock is itself a noise source — timing uncertainty translates directly into amplitude error, and it dominates at high frequencies.
Oversampling deliberately samples well above Nyquist to relax the analog filter requirements and spread quantization noise over a wider band. Sigma-delta converters push this to an extreme with noise shaping — ⚠️ which is why a 1-bit converter at very high rate can outperform a 16-bit converter at Nyquist.
[DURABLE] Amplitude discretization. The rule of thumb: ~6 dB of SNR per bit. 16-bit ≈ 96 dB, 24-bit ≈ 144 dB (⚠️ in theory — real converters are limited by analog noise well before that).
⚠️ Quantization error is only noise-like if the signal is busy enough. For quiet or slowly-varying signals it becomes correlated with the signal and audible as distortion. Dither — adding a small amount of noise before quantizing — decorrelates the error and trades distortion for a slightly raised noise floor. ⚠️ It sounds absurd and it is correct: adding noise makes it sound better. Noise shaping pushes that noise into frequency bands where it matters less perceptually.
Also: clipping is a hard nonlinearity that generates broadband harmonics —
⚠️ leave headroom; DC offset eats dynamic range and breaks many algorithms
(high-pass it out); and float vs. fixed is §11 → dsp-implementation-tools-and-testing.
[DURABLE] Fourier series (periodic), Fourier transform (continuous, infinite), DTFT (discrete-time, continuous frequency), DFT (discrete both — ⚠️ what you can actually compute), and the FFT, which is an algorithm for the DFT, not a different transform. O(n log n) versus O(n²) — and that reduction is arguably the single most consequential algorithm in engineering.
Related transforms: DCT (real-valued, energy-compacting — ⚠️ the basis of JPEG
and MP3/AAC), MDCT (overlapping, critically sampled — ⚠️ what modern audio codecs
actually use), Hilbert (analytic signal, envelope, instantaneous phase),
wavelets (multi-resolution — §7 → dsp-convolution-multirate-and-spectral-analysis), and the Z-transform (the discrete analogue of
Laplace, and the language of filter design — §3).
⚠️ GOTCHA — every one of these produces a wrong plot that looks plausible:
- ⚠️ The DFT assumes your signal is periodic with period N. It isn't. The discontinuity between the last sample and the first creates spectral leakage — energy smeared across all bins.
- Windowing is the mitigation, and it has a cost. Multiplying by a taper (Hann, Hamming, Blackman–Harris, Kaiser) reduces leakage and widens the main lobe, so you trade frequency resolution for dynamic range. ⚠️ Rectangular (no window) has the narrowest main lobe and the worst sidelobes — it's the right choice only when your signal is genuinely periodic in the window.
- Bin spacing is fs/N. ⚠️ A frequency between bins spreads across neighbours — "scalloping loss." This is why a pure tone rarely shows as a single clean spike.
- ⚠️ Zero-padding does not add resolution. It interpolates the spectrum — smoother plot, same underlying resolution. The resolution is set by the observation duration, full stop.
- Normalization conventions differ between libraries — where the 1/N goes. ⚠️ Check before comparing magnitudes across tools.
- Real input → conjugate-symmetric spectrum. Use
rfftand halve your work.- ⚠️ The FFT is fastest for highly composite N (powers of two ideally). A prime N falls back to a slower path — in older or naive implementations, dramatically slower.
Δf = fs/N = 1/T, where T is the observation duration. ⚠️ This is the whole story:
to resolve two tones 1 Hz apart you need at least one second of data. No window, no
zero-padding, and no algorithm changes it — though parametric methods (§7.3 → dsp-convolution-multirate-and-spectral-analysis) can beat it
by assuming a model.
[DURABLE] Δt · Δf ≥ constant. Short windows localize events in time and blur them in
frequency; long windows do the reverse. ⚠️ Every spectrogram you have ever looked at is a
choice on this curve, and picking the window length is the main design decision in
time-frequency analysis (§7 → dsp-convolution-multirate-and-spectral-analysis).
[DURABLE] The core tool. Choose the class first, then the design method.
| FIR | IIR | |
|---|---|---|
| Feedback | None | Yes |
| Stability | ⚠️ Always stable | ⚠️ Can be unstable; must check poles |
| Phase | ⚠️ Exactly linear phase available (symmetric taps) | Nonlinear phase; group delay varies |
| Order for a given sharpness | ⚠️ Much higher | Much lower — often 10× fewer coefficients |
| Fixed-point behaviour | Well-behaved | ⚠️ Coefficient quantization can destabilize |
| Analogue equivalent | None | Butterworth, Chebyshev, Elliptic, Bessel |
⚠️ The decision rule: linear phase required (audio, images, anything where waveform shape matters)? FIR. Tight compute budget and phase doesn't matter (control loops, simple smoothing)? IIR.
FIR methods: windowed sinc (simple, adequate), Parks–McClellan / Remez (⚠️ optimal equiripple for a given order — the professional default), least squares, frequency sampling.
IIR methods: design in the analogue domain and transform — bilinear transform (⚠️ warps frequency; pre-warp your critical frequencies or your cutoff lands in the wrong place), or impulse invariance. The classical families: Butterworth (maximally flat passband), Chebyshev I/II (ripple traded for steeper rolloff), Elliptic (steepest, ripple everywhere), Bessel (⚠️ maximally flat group delay — the one to use when waveform shape matters more than magnitude).
⚠️ Always implement high-order IIR as cascaded second-order sections (biquads / SOS).
A direct-form high-order IIR is numerically fragile and can be unstable purely from
coefficient quantization. ⚠️ scipy.signal defaults to transfer-function output for
historical reasons — ask for output='sos'.
Group delay is the derivative of phase — ⚠️ it's what actually smears your waveform, and it's frequency-dependent for IIR. Filtfilt / zero-phase filtering runs the filter forwards and backwards to cancel phase — ⚠️ excellent offline, impossible in real time, and it squares the magnitude response (so your -3 dB point moves). Transient response at startup matters for short signals. And the everyday filters: moving average (⚠️ the crudest low-pass; its frequency response is a sinc with poor stopband), exponential/one-pole (cheap, adequate), median (nonlinear; ⚠️ excellent for impulsive noise where linear filters smear it), Savitzky–Golay (⚠️ smooths while preserving peak shape — the right choice for spectroscopy and chromatography), notch for mains hum, DC blocker, all-pass for phase shaping.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
5 skills in this plugin
/dsp-audio-rf-and-imagesUse when working in a specific signal domain: audio and speech (psychoacoustics, coding and codecs, the real-time voice pipeline with echo cancellation, noise suppression and latency budgets, music and analysis), RF and communications (modulation, software-defined radio, synchronization, equalization), and images and video treated as two-dimensional signals./dsp-convolution-multirate-and-spectral-analysisUse when processing or analyzing a sampled signal: convolution and correlation including fast convolution via the FFT and overlap-add and overlap-save, multirate processing (decimation, interpolation, polyphase, resampling), adaptive filtering and estimation (LMS, RLS, Kalman, Wiener), and spectral analysis and time-frequency methods including Welch's method and wavelets./dsp-implementation-tools-and-testingUse when getting DSP to run correctly on real hardware: implementation (fixed-point arithmetic and Q formats, overflow and saturation, real-time constraints, block processing), the tool landscape (NumPy and SciPy, MATLAB, GNU Radio, JUCE, CMSIS-DSP), testing and debugging DSP against known signals and reference implementations, and sensors and physical signals including calibration and drift./dsp-referenceUse when checking a DSP anti-pattern, weighing a contested question, confirming whether a claim about the classical-versus-learned audio convergence is still current (snapshot verified August 2026), finding the books, primary sources and people, or needing the numbers, a method picker, and the when-it-sounds-or-looks-wrong list. Companion to the other signal-processing skills.npx claudepluginhub the-vibey-project/vibey --plugin signal-processing