Spectral Panner — User Guide

Frequency-dependent equal-power stereo panning with a smooth spectral crossover.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2026) License: MIT License Application: Praat scripting language
Contents:

What this does

Spectral Panner distributes a sound across stereo according to frequency. The input is first converted to a single mono working source. Its complex spectrum is then copied into left and right branches, and each frequency bin receives a complementary pair of equal-power gains.

Below the crossover region, the spectrum is biased toward one side; above it, the bias moves to the opposite side. Inside the crossover region, the pan position moves smoothly between the two sides with a raised-cosine transition. Pan depth determines how far the low and high ends move away from the centre.

Musical result: the same source can occupy different stereo positions at different frequencies. At full depth, low and high frequency regions can approach opposite sides while the crossover centre remains equally distributed between left and right. At smaller depths, the spectrum stays closer to the stereo centre.

Quick start

  1. Select exactly one Sound object in Praat.
  2. Run Panning_filter.praat.
  3. Choose a preset or select Custom.
  4. Set the Crossover frequency and Crossover width.
  5. Choose whether low frequencies begin on the Left or Right.
  6. Set Pan depth: 0 keeps every frequency centred; 1 allows the low and high ends to reach opposite sides.
  7. Enable Draw response if you want to inspect the actual left/right gain curves.
Starting point: Classic Mid (500 Hz) uses a 500 Hz crossover, 100 Hz transition width and full pan depth. Subtle Split reduces the depth to 70% and uses a broader transition.

Signal flow

1. Prepare the working source

The selected Sound is converted to mono when it contains more than one channel. A mono input is copied directly. Processing is therefore based on one common spectral source, and the final output is always stereo.

2. Transform the complete source to a complex spectrum

The mono source is sent to Praat's Sound: To Spectrum... with Fast = yes. In Praat, this means that zero samples may be appended so the transform length becomes a power of two; it does not apply a Hann analysis window.

3. Apply frequency-dependent stereo gains

The full complex spectrum is copied into left and right branches. Each branch is multiplied by a real gain function, so both the real and imaginary components are scaled together and the phase of each retained frequency component is preserved.

4. Reconstruct and crop

Each modified Spectrum is converted back to Sound. Any zero-padding introduced by the fast transform is removed by extracting exactly the original duration, and the two reconstructed channels are combined into one stereo Sound.

5. Restore time and apply safety attenuation

The original start time is restored. If the resulting stereo peak exceeds 0.99, both channels are attenuated by the same factor so the peak becomes 0.99. Quieter outputs are never boosted.

Equal-power spectral panning

The transition is defined by three frequencies:

lowEdge = max(crossover - width/2, 0) highEdge = min(crossover + width/2, Nyquist) s(f) = 0 below lowEdge s(f) = 1 above highEdge s(f) = 0.5 - 0.5 cos(pi·position) inside the transition

For Low frequencies to Left, the pan position moves from -depth at the low end to +depth at the high end. Choosing Right reverses that direction.

panPosition = depth · (2s - 1) [Low -> Left] panPosition = depth · (1 - 2s) [Low -> Right] angle = (panPosition + 1) · pi/4 Left gain = cos(angle) Right gain = sin(angle) Left gain^2 + Right gain^2 = 1

This is the constant-power property used by the processor. At the stereo centre, both channel gains are sqrt(0.5) (about −3.01 dB each). At Pan depth = 0, every frequency is at that centre position. At full depth, frequencies outside the transition can reach one channel with gain 1 and the other with gain 0.

Near DC or Nyquist: the requested transition band is clipped to the available spectral range. The visualization reports the actual low and high edges used by the processor.

Presets

PresetCrossoverWidthDepth
CustomUser valueUser valueUser value
Subtle Split800 Hz150 Hz0.70
Classic Mid500 Hz100 Hz1.00
Deep Bass Left200 Hz50 Hz1.00
High Split2000 Hz300 Hz0.80
Wide Separation600 Hz400 Hz1.00
Preset scope: presets set crossover frequency, crossover width and pan depth. The Low frequencies to direction remains the value chosen in the form, so any preset can be mirrored left-to-right.

Parameters

ParameterDefaultMeaning
PresetCustomLoads one of five predefined crossover/depth combinations, or leaves the manual values active.
Crossover frequency (Hz)500Nominal centre of the spectral transition. Must be above 0 Hz and below Nyquist.
Crossover width (Hz)100Width of the raised-cosine transition before clipping at DC/Nyquist.
Low frequencies toLeftChooses the low-frequency side; the high-frequency direction is automatically the opposite.
Pan depth1.00 = centre at all frequencies; 1 = maximum opposite-side separation. Values outside 0–1 are clamped.
Draw responseOnDraws the actual left/right channel-gain curves and processing summary.
Play resultOnPlays the final stereo object after processing.

Input & output behavior

PropertyBehavior
Input selectionExactly one Sound object.
Channel handlingAny input with more than one channel is converted to one mono working source. The output is always stereo; the original stereo or multichannel image is intentionally replaced.
Sample ratePreserved.
DurationPreserved exactly after removing FFT zero-padding.
Start timeThe original xmin is restored.
Output name<original>_specpan
Output levelNatural result unless peak exceeds 0.99; then attenuation-only safety is applied. There is no upward normalization.
RandomnessNone. The processor is deterministic for the same source and settings.
Depth-zero reference: with Pan depth = 0, both output channels contain the mono working source at sqrt(0.5) gain. This is the centre position of the equal-power pan law, not a unity-gain dual-mono copy.

Visualization

When Draw response is enabled, the Picture window shows the actual frequency-dependent gains used by the processor.

The plot is a filter/panning response diagram; it does not display the spectrum of the selected source.

Technical notes

Praat stores Spectrum objects as real and imaginary components of the complex spectrum. Multiplying both by the same real channel gain changes the amplitude assigned to that channel while retaining the phase of that spectral component. Praat's documentation also specifies that Fast = yes appends zeroes when needed for a power-of-two FFT, and that converting the Spectrum back to Sound reproduces the original Sound plus any appended zeroes.

Because the entire source is transformed as one block, the panning curve is static over time. The frequency-dependent stereo image does not follow pitch, intensity or other source features.