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.
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.
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
- Select exactly one Sound.
- Run
Hilbert_Transform.praat. - Start with Subtle Reverse Swell or Pad-like Bloom.
- Increase Reverse amount for a stronger temporal inversion of the dynamic contour.
- Use longer smoothing for broad swells and shorter smoothing for more responsive articulation.
Presets
| Preset | Smoothing | Exponent | Max correction | Reverse amount |
|---|---|---|---|---|
| Subtle Reverse Swell | 180 ms | 0.85 | ±6 dB | 0.40 |
| Strong Reverse Attack | 90 ms | 1.35 | ±12 dB | 0.85 |
| Pad-like Bloom | 260 ms | 1.15 | ±10 dB | 0.80 |
| Percussive Reverse | 55 ms | 1.20 | ±9 dB | 0.70 |
| Gentle Fade-In | 320 ms | 0.80 | ±6 dB | 0.55 |
| Dramatic Swell | 140 ms | 1.60 | ±15 dB | 1.00 |
Controls
| Control | Meaning |
|---|---|
| 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 exponent | Shapes 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 amount | Log-domain depth: 0 gives unity control gain, 1 uses the full bounded target/current ratio. |
| Scale peak | Final target peak for every non-silent result. |
Processing pipeline
- Choose one analysis-driver channel. For multichannel input, the highest-RMS channel is used so anti-phase channels cannot cancel during analysis.
- Mirror-pad the analysis signal to reduce full-file FFT boundary ringing.
- Construct the Hilbert quadrature by rotating the complex Spectrum, with explicit DC and Nyquist handling.
- Compute analytic magnitude, smooth analytic energy forward and backward, then take the square root.
- Normalize and exponent-shape the slow contour E(t).
- Create the reversed target E(T−t), derive the bounded ratio, and apply
ratio^Reverse_amount. - Multiply that one positive slow gain into every original channel.
- Target-normalize the non-silent result to Scale peak.
Channels, duration and level
- Original channel count, duration and sample rate are preserved.
- One common gain contour is applied to all channels, preserving their relative phase and polarity.
- The analysis driver is the highest-RMS channel, not a mono sum.
- Reverse amount = 0 is not an exact amplitude bypass because the final non-silent Sound is still target-normalized to Scale peak.
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.