Autocorrelation-Based Self-Filtering — User Guide

A time-varying self-filter that derives a short color kernel from each frame's autocorrelation, removes the zero-lag impulse, and convolves the frame with the remaining correlation pattern. The processed signal can be blended with the dry source, level-matched, and optionally widened through small channel-dependent lag differences.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.3.2 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

The filter listens to the short-term repetition pattern inside the source and turns that pattern into a changing convolution kernel. Periodic or strongly structured material can therefore produce pronounced resonant coloration, while less correlated material produces a different, often subtler response. The kernel is recalculated for every overlapping frame, so the filtering follows changes in the source over time.

Autocorrelation in this tool

Autocorrelation compares a frame with time-shifted copies of itself. Repeated structures appear as peaks at corresponding time lags. The script keeps a short region around zero lag, removes the large zero-lag sample itself, normalizes the remaining color tail, and uses that tail as the convolution kernel. The original signal is added separately through the Dry/Wet control.

The result is not a fixed EQ curve and there is no explicit pitch detector. The filter kernel comes directly from each frame's autocorrelation and changes with the source.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run Autocorrelation-Based_Self-Filtering.praat.
  3. Choose a preset, or leave Manual selected and set the four processing controls yourself.
  4. Use Dry_wet_mix to decide how much of the self-filtered signal is heard.
  5. Leave Match_RMS_to_input enabled for automatic level alignment, or disable it when level change is part of the intended effect.
  6. Enable Spatial_stereo_widening if you want the channel-dependent lag variation described below.
  7. Click OK. The result is created as <source>_autocorr_<preset>.
Important: The effective analysis window cannot be shorter than 40 ms. If a smaller value is entered, the script raises it to 40 ms. The input must be at least as long as the effective window. Max_lag is automatically limited to half the window duration.

Presets

Presets override only Window_duration, Max_lag, Resonance_gain, and Dry_wet_mix. Stereo widening, RMS matching, peak normalization, visualization, and playback keep the values shown in the form.

PresetWindowMax lagResonance gainDry/Wet
Manualform valueform valueform valueform value
Tight/Metallic100 ms8 ms1.3055%
Medium/Resonant150 ms20 ms1.1555%
Loose/Ambient250 ms50 ms0.9550%
Extreme Resonance200 ms80 ms2.2070%
Subtle Enhancement120 ms15 ms0.6040%

Controls

ControlDefaultWhat it changes
PresetManualSelects one of the parameter sets above. Manual leaves the four processing values untouched.
Window_duration0.15 sLength of each local analysis/processing frame. The hop is always half this value, giving 50% frame spacing. Values below 0.04 s are raised to 0.04 s.
Max_lag0.02 sHalf-width of the autocorrelation region retained around zero lag. If it exceeds half the window duration, it is clamped to that limit.
Resonance_gain1.15Scales the normalized autocorrelation color tail before convolution. Higher values strengthen the wet self-filtering contribution before the Dry/Wet blend.
Dry_wet_mix0.55Linear amplitude blend: 0 = dry input, 1 = wet convolution result. Values outside 0–1 are rejected.
Spatial_stereo_wideningOnIntroduces a small lag difference between left and right processing for mono or stereo input. See Channels & stereo widening.
Match_RMS_to_inputOnAdjusts the result toward the input RMS after recombination. Upward gain is limited by Max_makeup_gain_dB; downward matching is not limited by that ceiling.
Max_makeup_gain_dB6.0 dBMaximum positive gain that RMS matching may add when the processed result is quieter than the input.
Peak_normalize_outputOffIf enabled, performs final target peak normalization after RMS matching.
Scale_peak0.95Target peak used only when Peak_normalize_output is enabled. Values above 1.0 are rejected.
Play_after_processingOnAuditions the result after processing. A separate playback-only safety rule is used if the stored result exceeds 1.0 peak.
Draw_visualizationOnDraws original/output waveforms, one example autocorrelation color kernel, and a parameter summary.

How the sound is processed

Processing flow

source channel → padded copy → overlapping Hanning frames → remove frame DC → autocorrelation → keep ±Max_lag → remove zero-lag sample → spectral-peak normalize the color tail → apply Resonance_gain → convolve the frame → Hanning trim → normalized overlap-add → exact-duration trim → linear Dry/Wet blend

Frame reconstruction

The frame hop is fixed at Window_duration / 2. The source frame and the center-trimmed convolution result both receive Hanning shaping. Processed frames are accumulated into a wet buffer, while a matching window-weight buffer is accumulated in parallel. Dividing by that weight buffer performs normalized overlap-add rather than simple concatenation.

The autocorrelation color kernel

For every frame, the script computes Praat's autocorrelation using sum amplitude scaling with zero outside the time domain. It extracts the region from −Max_lag to +Max_lag and applies a Hanning window. Because extraction is performed with Preserve times off, that extracted object has local times from 0 to 2×Max_lag; the original lag-0 point is therefore at local time Max_lag. That center sample is set to zero before normalization.

The remaining tail is converted to a spectrum, its largest magnitude is measured, and the tail is divided by that spectral peak multiplied by the sample rate. Resonance_gain then scales the normalized kernel before convolution.

Channels & stereo widening

InputSpatial wideningOutput behavior
MonoOnCreates stereo. Left uses Max_lag; right uses 1.12× Max_lag, capped at half the window duration.
StereoOnLeft and right source channels are processed independently. Left uses Max_lag; right uses 1.08× Max_lag, capped at half the window duration.
Mono or multichannelOffEach input channel is processed independently with the same Max_lag. Channel count is preserved.
More than 2 channelsOnThe widening branch is not used; all channels are processed independently with the same Max_lag and the original channel count is preserved.

Sample rate and nominal duration are preserved. Processing is performed on a work copy shifted to start at 0; the output is shifted back to the source's original start time after recombination.

Output level & safety

RMS matching

With Match_RMS_to_input enabled, the script compares the raw output RMS with the input RMS. If the result is quieter, positive makeup gain is limited to Max_makeup_gain_dB. If the result is louder, the script can attenuate it by the full amount required for RMS matching.

Peak normalization

Peak_normalize_output is off by default. When enabled, Scale peak performs target peak normalization to Scale_peak after RMS matching. Because it runs last, it can change the RMS relationship established by the preceding RMS-matching stage.

Stored output versus playback safety: If peak normalization is off, the created output is allowed to exceed an absolute peak of 1.0. The script prints a warning. When Play_after_processing is also enabled, it creates a temporary copy, scales only that copy to 0.99 for audition, plays it, and deletes it. The stored output itself is not changed by this playback safeguard.

Visualization

The Picture display contains:

Waveform scale: Original and output waveforms are auto-scaled independently. Their apparent vertical sizes are therefore not a direct amplitude comparison; use the displayed peak values for that comparison.

When stereo widening is active, the example kernel comes from the first processed channel, which uses the unmodified Max_lag value.