Time-domain RMS Envelope Follower — v1.4 User Guide

A power-domain attack/release envelope follower for extraction, self-gating/expansion, reversed-envelope shaping, ducking, and donor-to-recipient envelope transfer.

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

What this does

Time-domain RMS Envelope Follower v1.4 derives one control envelope from the selected Sound and uses it in five ways: extract the envelope, multiply the source by it, reverse it in time, invert it for ducking, or transfer it from a donor Sound to a recipient Sound.

Important naming note: the current detector is not a fixed-window RMS meter. Its default causal chain is square → channel-power average → optional power-signal downsampling → attack/release recursion → square root. This is best understood as a power-domain attack/release envelope follower. The historical script name is retained for continuity.

Quick start

  1. For Extract, Gate / Expand, Reverse, or Duck, select exactly one Sound.
  2. For Transfer, select exactly two Sounds: first selected = envelope donor, second selected = recipient.
  3. Run Time-domain_RMS_envelope_follower.praat.
  4. Choose a Mode and, optionally, one of the four presets.
  5. Set Attack, Release, Threshold and Curve exponent. Open Advanced settings only when detector behaviour, input span, processing rate, or normalization target must be changed.
  6. Click OK. The result remains selected and can optionally be played and visualized.
Useful starting point: the default Custom settings use Attack = 5 ms, Release = 50 ms, Threshold = -40 dB, Curve exponent = 1, causal detection, a 60 dB input span, 16 kHz power-envelope processing, and no peak normalization.

Detector pipeline

1. Power linking across channels

Each channel is squared independently, then the multichannel power signal is converted to mono. For stereo this corresponds to:

p(t) = [L(t)^2 + R(t)^2] / 2

This ordering is deliberate. A mono sum performed before squaring would incorrectly cancel anti-phase material such as L = s, R = -s.

2. Optional downsampling

If Use_downsampling is enabled and Processing_sample_rate is below the source rate, Praat resamples the power signal, not the audio waveform. The default processing rate is 16 kHz. Values below 1 kHz are rejected.

3. Causal power-domain attack/release

For the default detector, the recursion is:

e[n] = c · e[n−1] + (1−c) · p[n] c = exp(−1 / (f_env · τ)) use attack coefficient when p[n] > e[n−1] use release coefficient otherwise

The square root is taken after this recursion. Therefore the user-entered Attack and Release values are power-domain time constants, not direct amplitude 10–90% times.

Entered time constantApproximate amplitude transition
Attack τ10% → 90% ≈ 1.6507 × τ
Release τ90% → 10% ≈ 4.3945 × τ
With the default 5 ms attack and 50 ms release, the corresponding amplitude transitions are approximately 8.25 ms (10→90%) and 219.7 ms (90→10%).

4. File-start behaviour

Apply_attack_at_file_start = Off by default. The first detector sample is initialized from the first power sample, so a transient already present at the start of the file is not forced to ramp up from zero. When enabled, the detector starts from zero and the attack is applied at time zero as well.

5. Threshold, span, and curve

The raw amplitude envelope is mapped to a 0…1 control signal. The threshold is converted with 10^(Threshold_dB/20). Unless adaptive normalization is enabled, gain reaches 1 at:

top level = Threshold_dB + Input_span_above_threshold_dB

Values below threshold map to 0; values above the top of the span clamp to 1. The result is then shaped by:

gain = mapped_envelope ^ Curve_exponent

Normalize_envelope_to_detected_peak changes this behaviour: the detected file peak becomes the upper reference, so the mapping becomes file-dependent rather than fixed across files.

If the entire detected envelope stays below Threshold_dB, the mapped envelope is forced to exactly 0. This means Gate / Expand becomes silent, Duck passes at unity, and Extract produces a zero envelope unless peak normalization is requested (which is skipped when no signal crossed the threshold).

Five processing modes

ModeOperationOutput name
Extract (envelope only)Outputs the final 0…1 control envelope itself. If the detector was downsampled, it is resampled back to the source rate and clamped to 0…1.<source>_Envelope
Gate / Expandoutput = source × envelope. Quiet regions below threshold are suppressed; higher detected levels receive progressively larger gain up to 1.<source>_Gated
Reverse (swell/ghost)The mapped envelope is reversed in time, then multiplied with the original source. This is not 1 − envelope.<source>_Reverse
Duck (inverse)The mapped envelope becomes 1 − envelope, then multiplies the source. Strong detected regions are attenuated while below-threshold regions pass at unity.<source>_Ducked
Transfer (from donor)Builds the envelope from the first selected Sound and applies it to the second selected Sound. Alignment is by elapsed time from each Sound's own start.<recipient>_from_<donor>
Transfer duration rule: the recipient keeps its own duration. If it extends beyond the donor envelope, Praat formula lookup treats times outside the donor Sound as zero, so the recipient is silent after the donor ends. If the donor is longer, only the portion corresponding to the recipient duration is used.

Presets

Presets overwrite only Attack, Release, Threshold, Input span, and Curve exponent. They do not change Mode, detector type, start behaviour, downsampling, peak-normalization state, or visualization/playback options.

PresetAttackReleaseThresholdInput spanCurve
Snappy (Percussion)2 ms30 ms-30 dB60 dB0.5
Smooth (Vocals/Speech)20 ms200 ms-45 dB40 dB1.0
Sustain (Pads/Texture)200 ms800 ms-50 dB30 dB1.5
Crunch (Aggressive)1 ms10 ms-20 dB80 dB0.3

Parameters

Main form

ParameterDefaultMeaning
ModeGate / ExpandSelects one of the five operations described above.
PresetCustomOptional musical timing/shaping preset.
Attack_time_ms5 msPositive power-domain attack time constant.
Release_time_ms50 msPositive power-domain release time constant.
Threshold_dB-40 dBLower edge of the 0…1 envelope mapping, interpreted relative to sample amplitude 1.
Curve_exponent1.0Exponent applied after threshold/span mapping. Values <1 raise intermediate gains; values >1 suppress them more strongly.
Peak_normalize_outputOffIf enabled, scales the final result to Normalization_peak. For Gate/Duck/Reverse/Transfer this can change the absolute depth of the effect.
Advanced_settingsOffOpens the second dialog.
Show_visualizationOnDraws the four-part diagnostic figure.
Play_after_processingOnPlays the final result.

Advanced settings

ParameterDefaultMeaning
Detector_modeCausal attack/releaseDefault causal one-pole detector or the historical zero-phase dual-timescale smoother.
Apply_attack_at_file_startOffWhen On, initializes the envelope at zero so attack applies even to a transient at the first sample.
Input_span_above_threshold_dB60 dBPositive input-level span over which mapped gain rises from 0 to 1.
Normalize_envelope_to_detected_peakOffMaps the loudest detected point in the current file to 1, making the contour adaptive to that file.
Use_downsamplingOnAllows power-signal decimation when the requested processing rate is lower than the source rate.
Processing_sample_rate16000 HzDetector sample rate when downsampling occurs; values below 1000 Hz are rejected.
Normalization_peak0.99Peak target used only when Peak_normalize_output is enabled; must be >0 and ≤1.
Show_statisticsOnWrites detector, envelope, and result statistics to the Info window.

Visualization

When Show_visualization is enabled, v1.4 uses the standard AudioTools 8-inch layout:

The steady-state mapping deliberately omits attack/release history. It describes the level mapping after threshold/span/curve shaping, not the transient trajectory of the causal follower.

Limits & interpretation