Even-Odd Harmonic Binaural Separation — User Guide

Separates alternating harmonic regions around one global F0 into stereo channels: the odd-series output suppresses even-harmonic bands, while the even-series output suppresses odd-harmonic bands. Two methods are available: cascading Hann stop-band filters or single-pass spectral zeroing.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.5 License: MIT License Repo: Praat AudioTools

What this does

The script takes one selected Sound, converts multichannel material to a mono working source, determines one fundamental frequency F0, and builds one or both of two filtered versions:

Original harmonic grid: 1f 2f 3f 4f 5f 6f 7f 8f ... ODD-series output: 1f __ 3f __ 5f __ 7f __ ... suppresses EVEN-harmonic bands EVEN-series output: __ 2f __ 4f __ 6f __ 8f ... suppresses ODD-harmonic bands

The fundamental is harmonic 1, so it belongs to the odd series. The even-series output therefore suppresses the fundamental. This asymmetry is intentional and can make the two channels sound very different even when the filtering itself is working correctly.

What “separation” means here: this is notch-based or bin-zeroing separation around a harmonic grid. It does not estimate sinusoidal components and reconstruct only those components. Noise, inharmonic partials, subharmonics, and spectral energy outside the rejected bands remain in the processed channel.
“Binaural” in the script title means a left/right listening arrangement. No HRTF, head model, ITD, ILD, or binaural convolution is used. Odd and even versions are simply assigned to the two stereo channels for dichotic comparison.

Quick start

  1. Select exactly one Sound.
  2. Run Even-Odd_Harmonic_Binaural_Separation.praat.
  3. Choose a Preset to determine which series is placed in each output channel.
  4. Choose Cascading notches or Spectral zeroing.
  5. For automatic F0, set a realistic Pitch_floor and Pitch_ceiling.
  6. For manual operation, disable Auto_detect_F0 and enter Manual_F0_Hz. Preset 5 does this automatically.
  7. Set Maximum_frequency and Filter_width_factor.
  8. Run the script and inspect the LTAS panel if visualization is enabled.
Best suited to: relatively stable, monophonic harmonic sources. Because the script uses one F0 for the complete file, sustained notes are a much better fit than chords, glissandi, strong vibrato, percussion, or inharmonic material.

Presets

PresetLeft channelRight channelF0 behavior
1. Odd Left / Even RightOdd-series versionEven-series versionUses Auto_detect_F0 setting.
2. Even Left / Odd RightEven-series versionOdd-series versionUses Auto_detect_F0 setting.
3. Odd OnlyOdd-series versionSame Odd versionUses Auto_detect_F0 setting.
4. Even OnlyEven-series versionSame Even versionUses Auto_detect_F0 setting.
5. CustomOdd-series versionEven-series versionForces manual F0 from Manual_F0_Hz.

Presets 3 and 4 do not return mono Sounds. The chosen processed Sound is duplicated with Convert to stereo, so both output channels are identical.

Separation methods

Cascading notches — default

Starting from a copy of the mono source, the script repeatedly applies Praat's Hann stop-band filter at every harmonic that must be rejected.

rejectHalfWidth = F0 × Filter_width_factor For a rejected harmonic h: centre = h × F0 low = max(5 Hz, centre - rejectHalfWidth) high = centre + rejectHalfWidth Filter (stop Hann band): low, high, smoothing = 100 Hz

For the odd-series output, even harmonics are rejected. For the even-series output, odd harmonics are rejected. Each filtering pass becomes the input to the next pass.

Spectral zeroing

The source is transformed once to a whole-file Spectrum. A single formula sets every complex-spectrum bin whose frequency lies inside any rejected harmonic band to zero. The modified Spectrum is then inverse-transformed to a Sound.

if frequency lies inside ANY rejected band: spectrum bin = 0 else: spectrum bin = original value

This method gives sharper rejection than the cascading Hann filters, but its abrupt whole-file spectral editing can create time-domain ringing or pre-echo around transients. It is therefore a different trade-off, not simply a “higher quality” mode.

F0 detection and harmonic grid

Automatic detection

Pitch = To Pitch: time step = 0.01 s floor = Pitch_floor ceiling = Pitch_ceiling F0 = mean Pitch over the complete Sound

The detected value is one global mean F0. The notch grid does not follow a changing pitch contour. If Praat cannot obtain a defined mean pitch, the script falls back to Manual_F0_Hz and reports the fallback in the Info window.

Manual F0

Disable Auto_detect_F0 to use Manual_F0_Hz. Preset 5 always disables auto detection internally and uses the manual value.

Maximum harmonic

maxHarmonic = floor(Maximum_frequency / F0)

The processing loops also stop when a harmonic centre would exceed Nyquist − 200 Hz. Therefore, if Maximum_frequency is set above the usable bandwidth of the current Sound, fewer harmonics are actually filtered than the nominal maxHarmonic value suggests.

Filter width

Filter_width_factor controls the half-width of every rejected band, not its complete bandwidth:

half-width = F0 × factor full nominal rejected width = 2 × F0 × factor

For example, at F0 = 100 Hz and factor = 0.4, a notch centered on 200 Hz spans approximately 160–240 Hz: ±40 Hz, or 80 Hz total before considering the Hann transition behavior.

Large factors can remove wanted neighboring energy. Harmonic centres are only one F0 apart. At factor 0.5, adjacent rejection half-widths reach halfway toward neighboring harmonics; larger factors increasingly overlap the region belonging to the series intended to remain.

Parameters

ParameterDefaultActual role
PresetOdd Left / Even RightControls channel orientation, series-only output, or manual-F0 Custom mode.
MethodCascading notchesIterative Hann band-stop filtering or whole-file spectral bin zeroing.
Auto_detect_F0onUses mean Praat pitch over the complete file. Forced off by Preset 5.
Pitch_floor75 HzLower bound for automatic pitch analysis.
Pitch_ceiling600 HzUpper bound for automatic pitch analysis.
Manual_F0_Hz100 HzManual F0 and fallback when auto detection fails.
Maximum_frequency5000 HzUpper requested harmonic-grid limit; actual filtering also obeys Nyquist − 200 Hz.
Filter_width_factor0.4Rejected-band half-width as a proportion of F0.
Draw_visualizationonDraws the v0.5 harmonic-layout / LTAS / notch-pattern figure.
Play_resultonPlays the final stereo Sound.

Level handling

The two processed series are peak-scaled independently to 0.95 before they are combined into stereo:

Odd-series Sound → Scale peak: 0.95 Even-series Sound → Scale peak: 0.95 then: combine / duplicate according to Preset
This is not energy-preserving decomposition. The original relative level between odd and even harmonic content is deliberately lost. A naturally weak series can be raised to the same peak range as a strong series, and residual filter leakage can also become more audible after independent scaling. Use the stereo result for separated listening and spectral comparison, not for measuring the original odd/even energy balance or for reconstructing the source by summing the channels.

Output

The result is always stereo and is named:

<source>_binaural_<presetName>_<methodName>

Method names used in object names are CascadeNotches and SpectralZero. Preset labels are OddL_EvenR, EvenL_OddR, OddOnly, EvenOnly, or Custom.

The Info window reports source duration, preset, method, F0 and whether it was detected or manual, nominal notch half-width, nominal maximum harmonic, output channel roles, output duration, and final peak.

Visualization v0.5

The current 8 × 8 visualization separates the intended harmonic routing from the measured output spectrum.

TITLE source | preset | method | F0 | nominal max harmonic | notch half-width PANEL A — Harmonic layout (target distribution) ideal harmonic positions up to min(Maximum_frequency, 2500 Hz) blue = odd-series harmonics orange = even-series harmonics displayed in the channel zone selected by the preset PANEL B — Actual output LTAS blue = final Left channel orange = final Right channel measured from the actual delivered stereo Sound 60 dB display range below the stronger LTAS maximum PANEL C — Notch pattern rejected even-harmonic bands used to create the odd-series output rejected odd-harmonic bands used to create the even-series output width reflects F0 × Filter_width_factor PANEL D — Output waveform final Left and Right channels on one shared amplitude scale PANEL E — Summary preset | method | F0 | width factor | nominal harmonic limit L/R role | duration | peak reminder that the fundamental belongs to the odd series
The LTAS panel is the measured check. Panel A is only the target harmonic grid. Because both series are independently peak-scaled before stereo assembly, LTAS level differences should not be interpreted as the source's original odd/even energy ratio.

Implementation notes & limitations