Hilbert Reverse Dynamics — User Guide

Uses analytic-signal magnitude to estimate a slow amplitude contour, then drives the original sound toward the time-reversed version of that contour without reversing the audio itself.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.7 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

Hilbert Reverse Dynamics extracts a slow amplitude contour from the input, reverses that contour in time, and derives a bounded positive gain that moves the original sound's dynamics toward the reversed target. The audio itself is not played backwards: attacks, waveform order and channel timing remain in their original temporal direction.

current contour = E(t) target contour = E(T − t) ratio = clamp(E(T − t) / E(t), ±Max_correction_dB) gain = ratio ^ Reverse_amount output(t) = input(t) · gain(t)
Why use a Hilbert transform? The script combines the real signal x(t) with its quadrature component H{x(t)} to form an analytic-signal magnitude √(x² + H{x}²). It then smooths energy strongly before deriving the control contour. The Hilbert transform is therefore an analysis tool here, not an audible 90° phase-shift effect.

Hilbert transform and the analytic signal

The Hilbert transform produces a quadrature version of a signal: in the frequency-domain view, positive-frequency components are shifted by approximately −90° and negative-frequency components by +90°. Combining a real signal with its Hilbert transform as a complex pair gives the analytic signal. Its magnitude is widely used as an amplitude/envelope estimate.

Raw analytic magnitude can fluctuate rapidly on complex or polyphonic audio because partials beat against one another. This script deliberately avoids using that raw curve as an audio-rate modulator. It squares the magnitude, applies forward/backward one-pole smoothing, takes the square root, normalizes the slow contour, and only then constructs the reverse-dynamics gain.

Quick start

  1. Select exactly one Sound.
  2. Run Hilbert_Transform.praat.
  3. Start with Subtle Reverse Swell or Pad-like Bloom.
  4. Increase Reverse amount for a stronger temporal inversion of the dynamic contour.
  5. Use longer smoothing for broad swells and shorter smoothing for more responsive articulation.

Presets

PresetSmoothingExponentMax correctionReverse amount
Subtle Reverse Swell180 ms0.85±6 dB0.40
Strong Reverse Attack90 ms1.35±12 dB0.85
Pad-like Bloom260 ms1.15±10 dB0.80
Percussive Reverse55 ms1.20±9 dB0.70
Gentle Fade-In320 ms0.80±6 dB0.55
Dramatic Swell140 ms1.60±15 dB1.00

Controls

ControlMeaning
Envelope smoothing (ms)Time constant of the two-sided slow-envelope smoothing. Roughly 60–300 ms is the intended clean range; very small values let faster beating into the control contour.
Envelope exponentShapes the normalized slow contour before reversal. Values below 1 reduce contrast; values above 1 increase it.
Max correction (dB)Symmetric bound on the gain needed to move the current envelope toward the reversed target; internally limited to at most 36 dB.
Reverse amountLog-domain depth: 0 gives unity control gain, 1 uses the full bounded target/current ratio.
Scale peakFinal target peak for every non-silent result.

Processing pipeline

  1. Choose one analysis-driver channel. For multichannel input, the highest-RMS channel is used so anti-phase channels cannot cancel during analysis.
  2. Mirror-pad the analysis signal to reduce full-file FFT boundary ringing.
  3. Construct the Hilbert quadrature by rotating the complex Spectrum, with explicit DC and Nyquist handling.
  4. Compute analytic magnitude, smooth analytic energy forward and backward, then take the square root.
  5. Normalize and exponent-shape the slow contour E(t).
  6. Create the reversed target E(T−t), derive the bounded ratio, and apply ratio^Reverse_amount.
  7. Multiply that one positive slow gain into every original channel.
  8. Target-normalize the non-silent result to Scale peak.

Channels, duration and level

Visualization

The original and processed waveforms share one amplitude scale. A central panel overlays the raw Hilbert magnitude, the smoothed current contour E(t), and the reversed target E(T−t). A separate panel shows the Hilbert quadrature of the selected analysis channel, and the summary reports smoothing, exponent, reverse amount and the realized gain range.

Historical and technological context

The Hilbert transform comes from early twentieth-century harmonic analysis associated with David Hilbert and later work on conjugate functions. Its importance in modern signal processing is closely tied to the analytic signal: Dennis Gabor's 1946 communication-theory work formalized the use of a real signal together with a quadrature companion for joint amplitude/phase analysis. In this script that tradition is used compositionally: analytic magnitude becomes a control signal for reshaping large-scale dynamics rather than an end in itself.

Further reading

Gabor, D. (1946). “Theory of communication. Part 1: The analysis of information.” Journal of the Institution of Electrical Engineers — Part III, 93(26), 429–441. DOI: 10.1049/ji-3-2.1946.0074.