Pitch-Based Spectral Notch — User Guide
A static, pitch-informed stop-band filter that places one Hann-smoothed spectral notch at a chosen multiple of the source's mean fundamental frequency.
What this does
Pitch-Based Spectral Notch analyzes the selected sound to estimate one representative fundamental frequency, then places a single fixed spectral stop band at a chosen multiple of that value. For example, with a mean F0 of 150 Hz and Harmonic number = 2, the notch is centered at 300 Hz.
The notch width is specified musically in semitones, so its lower and upper edges are symmetric in frequency ratio rather than in Hz. Praat's Hann-smoothed stop-band filter is then applied identically and independently to every channel. The filtered result can be blended with the original using Dry/Wet.
Signal flow
Selected Sound ↓ Dry/Wet = 0 ? ── yes ──→ exact copy; pitch analysis skipped ↓ no Mono analysis copy ↓ Praat pitch analysis → mean F0 over voiced frames ↓ notch centre = mean F0 × harmonic number ↓ total semitone width → logarithmic lower / upper edges ↓ clip notch geometry to the sampled spectrum ↓ Praat Sound: Filter (stop Hann band) ↓ optional Dry/Wet blend with original multichannel Sound ↓ optional safety attenuation to 0.99 ↓ multichannel output with original duration, sample rate and start time
Quick start
- Select exactly one Sound object.
- Run
Pitch-Based_Spectral_Notch.praat. - Choose a preset, or use Custom.
- Set Min pitch and Max pitch so Praat can identify the intended periodicity.
- Choose the Harmonic number: 1 targets the mean fundamental, 2 targets twice F0, 4 targets four times F0, and non-integer values are also allowed.
- Set the notch's total width in semitones and its Hann transition width in Hz.
- Set Dry/Wet and run the script.
Pitch analysis
When Dry/Wet is above zero, the script creates a mono analysis signal and calls Praat's To Pitch command with a 10 ms time step and the user-defined pitch floor and ceiling. The mean F0 is then measured across the voiced Pitch frames.
For multichannel material, the normal analysis source is the mono sum. If that sum yields no usable pitch—for example because strongly anti-phase channels cancel—the script tests the individual channels and uses the channel with the largest number of voiced Pitch frames.
Notch geometry
The target center is:
center = mean F0 × Harmonic number
Notch width semitones is the total logarithmic width. The script therefore uses half that width on each side:
half-width ratio = 2^(width / 24) lower edge = center / half-width ratio upper edge = center × half-width ratio
For a 12-semitone notch, the full span is one octave: the edges lie ±6 semitones from the center. If the upper edge exceeds Nyquist, it is clipped to Nyquist. If the entire requested band lies outside the sampled spectrum, the notch is inactive and the output remains an unfiltered copy.
Hann transition
Smoothing Hz controls the transition region between the stop band and pass band. Praat's stop-Hann filter multiplies the complex spectrum by a real-valued, Hann-shaped transition, so the operation is a zero-phase frequency-domain filter. The smoothing value is limited internally to at most half the Nyquist frequency.
Presets
| Preset | Harmonic | Total width | Smoothing |
|---|---|---|---|
| Custom | User value | User value | User value |
| Remove Fundamental | 1 × F0 | 4 st | 40 Hz |
| Remove Second Harmonic | 2 × F0 | 4 st | 40 Hz |
| Remove Upper Harmonics (4th) | 4 × F0 | 18 st | 100 Hz |
| Wide Notch | 1 × F0 | 12 st | 80 Hz |
| Narrow Notch | 1 × F0 | 2 st | 20 Hz |
Harmonic number, Notch width semitones, and Smoothing Hz. Pitch range, Dry/Wet, Safety peak, visualization, and playback remain user-controlled.Parameters
| Parameter | Default | Meaning |
|---|---|---|
| Min pitch | 75 Hz | Lower limit of the pitch search. |
| Max pitch | 600 Hz | Upper limit of the pitch search. |
| Harmonic number | 1 | Multiplier applied to the measured mean F0. Any positive real value is accepted. |
| Notch width semitones | 6 st | Total logarithmic stop-band width. |
| Smoothing Hz | 50 Hz | Width of the Hann transition between stop and pass regions. |
| Dry/Wet mix | 1.0 | 0 = exact dry copy; 1 = fully filtered. Values are clamped to 0–1. |
| Safety peak | 0.99 | Attenuates processed output only when its absolute peak exceeds this value. 0 disables the safety stage. |
| Draw visualization | On | Draws the AudioTools diagnostic page. |
| Play after processing | On | Plays the final Sound. |
Input & output behavior
| Property | Behavior |
|---|---|
| Channels | Preserved. The same spectral filter is applied independently to every channel. |
| Pitch-analysis channel | Mono sum by default; individual-channel fallback only if the mono analysis produces no valid mean pitch. |
| Dry/Wet = 0 | Exact sample bypass. Pitch analysis and filtering are skipped. |
| Duration | Preserved. |
| Sample rate | Preserved. |
| Start time | Preserved, including non-zero xmin. |
| Output name | original_notched_PresetName |
| Output level | No normalization or upward gain. When processing is active and the peak exceeds Safety peak, the entire result is attenuated to that ceiling. |
| Randomness | None; identical input and settings produce identical output. |
Visualization
The v1.2 visualization is a diagnostic view of the actual static filter:
- Input / Output waveforms for the first up to 10 seconds.
- Input / Output spectrograms with dotted lines marking the notch lower edge, center, and upper edge.
- Spectrum comparison using one shared input-spectrum reference so absolute level changes remain visible.
- Measured output-minus-input spectrum, showing the actual attenuation produced across frequency.
- Summary strip with center, applied band, width, transition, wet percentage, peak behavior, channel count, and start time.
For display, multichannel Sounds are converted to mono copies only. These visualization copies do not alter the processed audio.
Notes & limitations
- Static target: a pitch contour that moves substantially over time will move away from the fixed notch. The processor is best understood as pitch-informed spectral placement, not pitch-following filtering.
- Mean F0: the single target depends on which frames Praat marks as voiced inside the selected pitch range.
- Higher multipliers: the requested target can approach or exceed Nyquist; the stop band is clipped to the sampled spectrum or becomes inactive if fully outside it.
- Zero-phase filtering: Praat's frequency-domain Hann filtering has a symmetric, acausal impulse response, so energy around sharp events can extend to both sides of a transient.
- Multichannel analysis versus processing: pitch is estimated from one analysis signal, but the resulting filter is shared by every channel.
Further reading
- Praat manual — Sound: Filter (stop Hann band)...
- Praat manual — Spectrum: Filter (stop Hann band)...
- Praat manual — Filtering
- Praat manual — Sound: To Pitch...
- Boersma, P. (1993). Accurate short-term analysis of the fundamental frequency and the harmonics-to-noise ratio of a sampled sound. Proceedings of the Institute of Phonetic Sciences, University of Amsterdam, 17, 97–110.