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.
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.
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.
- Five modes: Extract, Gate / Expand, Reverse, Duck, Transfer.
- Linked multichannel detection: channels are squared first, then their powers are averaged, so anti-phase channels do not cancel.
- Causal detector by default: separate attack and release time constants in the power domain.
- Legacy detector available: zero-phase dual-timescale smoothing from v1.1, explicitly labelled acausal.
- Optional downsampling after rectification: full-band source energy contributes before the power signal is decimated.
- Absolute-time safe: non-zero Sound start times are handled correctly; Transfer aligns donor and recipient by relative time.
- Peak normalization: optional and OFF by default.
Quick start
- For Extract, Gate / Expand, Reverse, or Duck, select exactly one Sound.
- For Transfer, select exactly two Sounds: first selected = envelope donor, second selected = recipient.
- Run
Time-domain_RMS_envelope_follower.praat. - Choose a Mode and, optionally, one of the four presets.
- Set Attack, Release, Threshold and Curve exponent. Open Advanced settings only when detector behaviour, input span, processing rate, or normalization target must be changed.
- Click OK. The result remains selected and can optionally be played and visualized.
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:
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:
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 constant | Approximate amplitude transition |
|---|---|
| Attack τ | 10% → 90% ≈ 1.6507 × τ |
| Release τ | 90% → 10% ≈ 4.3945 × τ |
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:
Values below threshold map to 0; values above the top of the span clamp to 1. The result is then shaped by:
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.
Five processing modes
| Mode | Operation | Output 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 / Expand | output = 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> |
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.
| Preset | Attack | Release | Threshold | Input span | Curve |
|---|---|---|---|---|---|
| Snappy (Percussion) | 2 ms | 30 ms | -30 dB | 60 dB | 0.5 |
| Smooth (Vocals/Speech) | 20 ms | 200 ms | -45 dB | 40 dB | 1.0 |
| Sustain (Pads/Texture) | 200 ms | 800 ms | -50 dB | 30 dB | 1.5 |
| Crunch (Aggressive) | 1 ms | 10 ms | -20 dB | 80 dB | 0.3 |
Parameters
Main form
| Parameter | Default | Meaning |
|---|---|---|
| Mode | Gate / Expand | Selects one of the five operations described above. |
| Preset | Custom | Optional musical timing/shaping preset. |
| Attack_time_ms | 5 ms | Positive power-domain attack time constant. |
| Release_time_ms | 50 ms | Positive power-domain release time constant. |
| Threshold_dB | -40 dB | Lower edge of the 0…1 envelope mapping, interpreted relative to sample amplitude 1. |
| Curve_exponent | 1.0 | Exponent applied after threshold/span mapping. Values <1 raise intermediate gains; values >1 suppress them more strongly. |
| Peak_normalize_output | Off | If enabled, scales the final result to Normalization_peak. For Gate/Duck/Reverse/Transfer this can change the absolute depth of the effect. |
| Advanced_settings | Off | Opens the second dialog. |
| Show_visualization | On | Draws the four-part diagnostic figure. |
| Play_after_processing | On | Plays the final result. |
Advanced settings
| Parameter | Default | Meaning |
|---|---|---|
| Detector_mode | Causal attack/release | Default causal one-pole detector or the historical zero-phase dual-timescale smoother. |
| Apply_attack_at_file_start | Off | When On, initializes the envelope at zero so attack applies even to a transient at the first sample. |
| Input_span_above_threshold_dB | 60 dB | Positive input-level span over which mapped gain rises from 0 to 1. |
| Normalize_envelope_to_detected_peak | Off | Maps the loudest detected point in the current file to 1, making the contour adaptive to that file. |
| Use_downsampling | On | Allows power-signal decimation when the requested processing rate is lower than the source rate. |
| Processing_sample_rate | 16000 Hz | Detector sample rate when downsampling occurs; values below 1000 Hz are rejected. |
| Normalization_peak | 0.99 | Peak target used only when Peak_normalize_output is enabled; must be >0 and ≤1. |
| Show_statistics | On | Writes detector, envelope, and result statistics to the Info window. |
Visualization
When Show_visualization is enabled, v1.4 uses the standard AudioTools 8-inch layout:
- Header: source/donor name, Mode, Preset, Detector and threshold.
- Panel 1: a steady-state input/output mapping for Extract, Gate / Expand and Duck. Reverse and Transfer do not have a single memoryless level mapping, so this panel shows the applied gain envelope instead.
- Panel 2: Source and envelope on their true relative amplitude scale. In Transfer, the recipient is shown here while the donor-derived gain appears in Panel 1 on its own time axis.
- Panel 3: final result waveform.
- Panel 4: summary of source, detector rate, timing, threshold/span, curve, normalization, peak and RMS.
Limits & interpretation
- Not fixed-window RMS: the causal detector is a power-domain one-pole follower followed by a square root.
- Not a calibrated loudness measure: Threshold_dB is a sample-amplitude mapping threshold, not LUFS, SPL, or a perceptual loudness model.
- Legacy mode is acausal: the zero-phase smoother can respond before the event that causes the level change.
- Very short attack/release values: if a time constant spans fewer than roughly two detector samples, the script reports that the detector is effectively following the power signal immediately.
- Peak normalization changes effect depth: because it applies one constant gain to the complete result after envelope multiplication.
- Reverse means time reversal of the envelope: it does not reverse the audio waveform and is not the same as Duck.
- Transfer is one-way: the donor supplies control only; the recipient supplies the audible samples.