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.

Author: Shai Cohen Version: 1.2 (2026) Application: Praat scripting language License: MIT License
Contents:

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.

Core idea: pitch analysis chooses the location of one static notch. The filter does not move from frame to frame; after the mean F0 has been measured, the same stop band is used for the whole sound.

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

  1. Select exactly one Sound object.
  2. Run Pitch-Based_Spectral_Notch.praat.
  3. Choose a preset, or use Custom.
  4. Set Min pitch and Max pitch so Praat can identify the intended periodicity.
  5. 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.
  6. Set the notch's total width in semitones and its Hann transition width in Hz.
  7. Set Dry/Wet and run the script.
Listening tip: use Remove Fundamental first on a clearly pitched source. If the desired component moves substantially in pitch through the file, remember that this processor uses one mean-F0 target rather than a moving notch.

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.

No valid pitch: if no pitch is found in the requested range, processing stops. Adjust Min pitch / Max pitch, or use material with a more stable periodic component.

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

PresetHarmonicTotal widthSmoothing
CustomUser valueUser valueUser value
Remove Fundamental1 × F04 st40 Hz
Remove Second Harmonic2 × F04 st40 Hz
Remove Upper Harmonics (4th)4 × F018 st100 Hz
Wide Notch1 × F012 st80 Hz
Narrow Notch1 × F02 st20 Hz
Preset behavior: presets override Harmonic number, Notch width semitones, and Smoothing Hz. Pitch range, Dry/Wet, Safety peak, visualization, and playback remain user-controlled.

Parameters

ParameterDefaultMeaning
Min pitch75 HzLower limit of the pitch search.
Max pitch600 HzUpper limit of the pitch search.
Harmonic number1Multiplier applied to the measured mean F0. Any positive real value is accepted.
Notch width semitones6 stTotal logarithmic stop-band width.
Smoothing Hz50 HzWidth of the Hann transition between stop and pass regions.
Dry/Wet mix1.00 = exact dry copy; 1 = fully filtered. Values are clamped to 0–1.
Safety peak0.99Attenuates processed output only when its absolute peak exceeds this value. 0 disables the safety stage.
Draw visualizationOnDraws the AudioTools diagnostic page.
Play after processingOnPlays the final Sound.

Input & output behavior

PropertyBehavior
ChannelsPreserved. The same spectral filter is applied independently to every channel.
Pitch-analysis channelMono sum by default; individual-channel fallback only if the mono analysis produces no valid mean pitch.
Dry/Wet = 0Exact sample bypass. Pitch analysis and filtering are skipped.
DurationPreserved.
Sample ratePreserved.
Start timePreserved, including non-zero xmin.
Output nameoriginal_notched_PresetName
Output levelNo normalization or upward gain. When processing is active and the peak exceeds Safety peak, the entire result is attenuated to that ceiling.
RandomnessNone; identical input and settings produce identical output.
The safety stage is deliberately inactive for an exact dry bypass and when the requested notch falls entirely outside the sampled spectrum.

Visualization

The v1.2 visualization is a diagnostic view of the actual static filter:

For display, multichannel Sounds are converted to mono copies only. These visualization copies do not alter the processed audio.

Notes & limitations

Further reading