Noise Gate — v2.4 User Guide

Stereo-linked noise gate and inverse-gate ducker with absolute dBFS thresholding, hysteresis, hold, attack/release smoothing, optional sidechain filtering, adaptive detector rate, and time-aligned edge padding.

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

What this does

Noise Gate v2.4 derives a control envelope from one selected mono or stereo Sound and multiplies the original audio by that envelope. In normal gate mode, the signal is passed at unity gain while the detector is open and attenuated toward the selected closed range when the detector closes. The Ducker preset reverses that gain assignment: detector activity reduces the signal, while inactive periods return toward unity gain.

Important level convention: threshold values are absolute dBFS detector levels, not “dB below the peak of this file.” The script converts Praat Intensity values to dBFS by subtracting 93.9794 dB before applying the threshold and hysteresis logic.

Quick start

  1. Select exactly one mono or stereo Sound in Praat.
  2. Run Noise_Gate.praat.
  3. Choose Custom or one of the six named presets.
  4. For Custom, set the absolute threshold, hysteresis, timing, closed range, optional mute, and sidechain filter.
  5. Leave Peak_normalize_final_output off when you want gating or ducking to preserve the resulting absolute level. Enable it only when you explicitly want the final peak scaled to 0.95.
  6. Click OK. Normal gating creates originalname_gated; the Ducker preset creates originalname_ducked.
Starting points: Medium is a general vocal setting; Tight and Aggressive use faster detector rates because of their sub-millisecond attack values. Ducker is a true inverse-gain mode, not merely a gate with a shallow range.

Detector and gate logic

1. Sidechain preparation

The script first copies the source into a sidechain path. If a sidechain filter is selected, that filter is applied before rectification. Mono detection uses abs(sample). Stereo detection is linked:

stereo detector sample = max(abs(L), abs(R))

This produces one mono detector signal and therefore one common gate envelope for both stereo channels.

2. Time-aligned padding and Intensity analysis

The detector is padded with 100 ms of near-silence at both ends before Intensity analysis, then shifted so the padded domain is aligned to t_start - 0.1 s through t_end + 0.1 s. This supplies analysis context at the original file boundaries rather than forcing the detector window to stop abruptly at the first and last source samples.

The analysis control rate is chosen from the fastest of attack, hold, and release:

Fastest requested timingControl rateBase Intensity floor
≥ 1.0 ms1 kHz100 Hz
0.5 to < 1.0 ms5 kHz400 Hz
< 0.5 ms10 kHz800 Hz

For very short sounds the Intensity floor may be raised further with ceil(9.6 / padded_duration). The script reports both the chosen control rate and its detector-window estimate in the Info window.

3. Absolute dBFS state machine

Gate thresholds

level_dBFS = Praat_Intensity_dB - 93.9794 open threshold = Threshold_dBFS close threshold = Threshold_dBFS - Hysteresis_dB if closed and level_dBFS > open threshold: state = open if open and level_dBFS < close threshold: state = closed

Normal gate mode maps the binary state to 1.0 when open and range_lin when closed. Ducker mode maps the same detector state in the opposite direction: an active/open detector uses range_lin, while the inactive state uses unity gain.

4. Hold and smoothing

The active state is extended by a control-rate hold counter. The resulting target envelope is then exponentially smoothed. In normal gate mode, rising gain uses Attack and falling gain uses Release. In Ducker mode, gain reduction uses Attack and recovery uses Release.

Nattack = max(1, round(Attack_ms * control_rate / 1000)) Nrelease = max(1, round(Release_ms * control_rate / 1000)) attack coefficient = 1 - exp(-4.6 / Nattack) release coefficient = 1 - exp(-4.6 / Nrelease)

The factor 4.6 makes the one-pole transition approach roughly 99% of its destination over the requested number of control samples.

The six presets (+ Custom)

PresetThresholdHyst.AttackHoldReleaseRangeMode
Gentle (speech)-35 dBFS4 dB2 ms100 ms150 ms-40 dBGate
Medium (vocals)-30 dBFS3 dB1 ms50 ms80 ms-60 dBGate
Tight (drums)-25 dBFS2 dB0.5 ms20 ms30 ms-80 dBGate
Aggressive (noise removal)-20 dBFS2 dB0.3 ms10 ms20 ms-80 dBGate
Ducker (inverse gate)-25 dBFS3 dB5 ms100 ms200 ms-12 dBDucker
Fast Choppy Gate-20 dBFS1 dB1 ms5 ms10 ms-80 dBGate
Preset scope: named presets override threshold, hysteresis, attack, hold, release, and range. They do not change Mute_when_closed, sidechain filter, final peak normalization, visualization, or playback.

Parameters and defaults

Threshold and timing

ParameterDefaultMeaning
Threshold_dBFS-30 dBFSAbsolute detector level above which a closed detector opens.
Hysteresis_dB3 dBNon-negative offset below the open threshold used to form the close threshold.
Attack_ms1 msOpening transition in Gate mode; gain-reduction transition in Ducker mode.
Hold_ms50 msExtends the current active/open detector state before release/recovery begins.
Release_ms50 msClosing transition in Gate mode; recovery transition in Ducker mode.

Closed or ducked gain

ParameterDefaultMeaning
Range_dB-80 dBFinite attenuation used for the closed Gate state or active Ducker state. Positive values are rejected.
Mute_when_closedOffForces range_lin = 0. In normal Gate mode this is a true closed-state mute; in Ducker mode it makes the active ducked state mute completely.

Sidechain filter

OptionDetector path
Off (full spectrum)No sidechain filtering.
High-pass 100 HzHann-band high-pass beginning at 100 Hz, 50 Hz smoothing.
High-pass 200 HzHann-band high-pass beginning at 200 Hz, 50 Hz smoothing.
Band 1-5 kHz (presence)Passes 1 kHz to min(5 kHz, Nyquist - 100 Hz) with 100 Hz smoothing. At sample rates too low to leave a usable band above 1 kHz, the filter step is skipped.

Output

ParameterDefaultMeaning
Peak_normalize_final_outputOffIf enabled, applies Scale peak: 0.95 after gating/ducking.
VisualizeOnDraws the v2.4 diagnostic page.
PlayOnPlays the final Sound.

Sidechain, control rate, and timing

Why the control rate changes: v2.4 is not a fixed-1-kHz gate. Slow and ordinary settings use 1 kHz, but faster requested timing automatically raises the control rate to 5 or 10 kHz so sub-millisecond presets are not forced onto a 1 ms grid.

After hold and attack/release processing, the gain envelope is resampled to the audio sampling rate with Praat Resample: sr, 50, trimmed if the resampled envelope contains more samples than the audio, and clamped to the interval range_lin ... 1. The same high-rate envelope is then multiplied into every audio channel.

Sidechain filters do not isolate the output band. They change only what the detector reacts to. For example, the 1-5 kHz setting can make the gate respond primarily to presence-band activity while the full-band source is still what passes through the gain envelope.

Output and reported statistics

The result is a copy of the selected Sound, so its audio format, channel count, sample rate, and time domain are retained. The script supports only mono and stereo input.

ModeOutput nameGain interpretation
Normal gate<name>_gatedUnity when open; range_lin when closed.
Ducker preset<name>_duckedrange_lin while detector is active; unity while inactive.

Average Gate Openness is derived from the mean smoothed gain envelope after compensating for the selected finite range. In Ducker mode the same calculation is labeled Average Unducked Gain.

Time Signal > Thresh is based on the binary detector state before hold and attack/release smoothing. Because the state machine includes hysteresis, this statistic is best read as the percentage of control frames for which the binary detector remained active, not as a literal sample-by-sample count of values strictly above the open threshold.

Peak normalization changes the level relationship created by the gate. Leave it off when absolute output level matters. When enabled, the script scales the final peak to 0.95 after the gate or ducker has been applied.

Visualization

The v2.4 Picture page contains three data panels plus a summary strip:

Amplitude scales: the Input and Output waveforms are drawn with Praat's automatic vertical scaling independently. Their apparent heights therefore should not be used as a direct visual measure of gain change. The envelope panel is the direct representation of applied gain.

Limits and interpretation