HFD-Driven Time Warping — User Guide
Measures frame-by-frame Higuchi Fractal Dimension (HFD), maps relative signal complexity to a continuous DurationTier, optionally pulls low-voicing regions toward unity stretch, and applies the same temporal map to every original channel.
What this does
HFD-Driven Time Warping creates a non-uniform time-scale transformation whose local duration factor is derived from the relative Higuchi Fractal Dimension of successive analysis frames.
The current processing chain is:
- Build a mono, zero-based analysis copy of the selected Sound.
- Downsample and high-pass that analysis copy.
- Measure frame RMS and HFD.
- Exclude low-level frames from HFD normalization and force them to 1× stretch.
- Smooth active HFD values and normalize them with either percentile or min/max mapping.
- Apply one of four monotonic mapping curves.
- Optionally use the HNR-derived voicing track to pull low-voicing regions toward 1×.
- Smooth and slew-limit the resulting stretch command.
- Create a linearly interpolated Praat DurationTier.
- Apply that same tier independently to every original channel with Manipulation overlap-add resynthesis.
What is Higuchi Fractal Dimension?
Higuchi Fractal Dimension is a time-series measure based on how the measured curve length changes when the signal is sampled at different integer step sizes k. The script estimates one HFD value for each analysis frame.
The implementation clamps the resulting dimension to 1–2. Higher values are treated as greater local irregularity/complexity; lower values as smoother or more regular. The important control variable is primarily the relative HFD range inside the current file, not an absolute audio-category threshold.
Quick start
- Select exactly one Sound object.
- Run
HFD-Driven_Time_Warping.praat. - Choose Custom or Subtle / Moderate / Dramatic / Extreme / Glitch.
- Choose Speech or Music_Field_Recording for the analysis high-pass filter.
- Use Show_advanced_settings when you need direct control of analysis, mapping, voicing, pitch bounds or speed settings.
- Run the script. The result is named
<source>_HFDwarp_<preset>.
Analysis pipeline
1. Mono fold and time domain
Multichannel input is converted to mono only for analysis. The analysis copy is shifted to a 0…T time domain, so non-zero Praat source times do not affect the control trajectory.
2. Downsampling
The script stops if this rate is not above twice Maximum_pitch_Hz. The resampling uses precision 50.
3. Material-dependent high-pass
| Material type | Analysis filter |
|---|---|
| Speech | High-pass at 100 Hz |
| Music / Field Recording | High-pass at 30 Hz |
This choice affects the analysis signal only. It does not filter the rendered output and does not otherwise change the preset parameters.
4. Frames
At least three analysis frames are required. After downsampling, a frame must contain at least 20 samples and at least 3 × K_max samples.
5. Silence / inactive-frame gate
The script computes the global RMS of the filtered, downsampled analysis signal:
Frames below this threshold are marked inactive. They are excluded from HFD normalization and map directly to 1× before the later smoothing stage. The default gate is −50 dB relative to the analysis RMS.
6. Windowed HFD
Unless Skip_windowing is enabled, each frame uses a Hann window. The weighted frame mean is divided by the sum of the Hann weights before the HFD differences are computed. Silent or degenerate frames return HFD = 1 rather than an arbitrary mid-range value.
HFD → stretch mapping
HFD smoothing
Each frame's smoothed HFD is the moving average of the active frames in its smoothing neighborhood. A neighborhood with no active frames receives HFD = 1.
Robust normalization
Only active frames participate in the mapping range. With percentile mapping enabled, the script uses approximately the 5th and 95th percentiles of the active smoothed HFD values; otherwise it uses their minimum and maximum.
If there are fewer than two active frames, or essentially no active HFD variation, the HFD mapping is disabled and the stretch command defaults toward 1×.
Four mapping curves
| Curve | Mapping of normalized HFD x | Effect |
|---|---|---|
| Linear | x | Direct mapping. |
| High-complexity emphasis | x² | Pushes low/mid values downward while preserving the high end. |
| Low-complexity lift | sqrt(x) | Raises lower/middle values toward the upper end. |
| Quantized steps | 0.125 / 0.375 / 0.625 / 0.875 | Four discrete normalized levels. |
Min_stretch_factor ≤ Max_stretch_factor, higher normalized HFD always maps to an equal or larger base stretch factor. The current script does not provide an inverted “high complexity → shorter” mapping.
Voicing gate — exact current behavior
When enabled, the script converts Praat Harmonicity (HNR) to a 0–1 voicing value:
The voicing track is then smoothed. Its effect on the HFD-derived stretch s is:
This means:
- v = 1:
rawStretch = s; strongly voiced material follows the HFD mapping. - v = 0: the gate blends the command toward 1×.
- Voicing_influence = 0: the gate has no effect.
- Voicing_influence = 1: low-voicing material is pulled most strongly toward unity.
Presets
| Preset | Frame / hop | K | HFD smooth | Stretch range | Curve | Voicing | Final smooth | Slew / s | Hann |
|---|---|---|---|---|---|---|---|---|---|
| Subtle | 60 / 60 ms | 4 | 7 | 0.85–1.15× | x² | On, 0.80; smooth 5 | 5 | 3 | Yes |
| Moderate | 50 / 50 ms | 5 | 5 | 0.70–1.50× | Linear | On, 0.70; smooth 4 | 4 | 4 | Yes |
| Dramatic | 50 / 50 ms | 5 | 4 | 0.50–2.00× | sqrt(x) | On, 0.60; smooth 3 | 3 | 6 | No |
| Extreme | 40 / 40 ms | 5 | 3 | 0.40–2.50× | sqrt(x) | On, 0.50; smooth 2 | 2 | 8 | No |
| Glitch | 30 / 30 ms | 4 | 2 | 0.40–2.50× | 4 steps | Off | 1 | 20 | No |
Subtle through Extreme use percentile mapping. Glitch uses min/max mapping.
Advanced settings
| Parameter | Custom default | Meaning |
|---|---|---|
| Frame_length_s | 0.05 | HFD analysis frame length. |
| Hop_size_s | 0.05 | Spacing between analysis frames. |
| K_max | 5 | Largest integer scale in the Higuchi estimate; must be at least 3. |
| Silence_gate_dB relative RMS | −50 | Inactive-frame threshold relative to global filtered analysis RMS; must be ≤ 0. |
| Smoothing_window_size | 5 | Moving average of active HFD values. |
| Min / Max stretch factor | 0.5 / 2.0 | Positive mapping endpoints; min must not exceed max. |
| Use_percentile_mapping | On | Use active-frame 5th/95th-percentile range instead of min/max. |
| Mapping_curve | Linear | Linear, x², sqrt(x), or four steps. |
| Use_voicing_gate | On | Enable HNR-based low-voicing pull toward 1×. |
| Voicing_influence | 0.7 | Blend strength, 0–1. |
| Voicing_smooth_window | 3 | Moving-average width for the HNR-derived voicing track. |
| Final_stretch_smooth | 3 | Moving-average width after mapping/gating. |
| Max_stretch_change_per_sec | 5.0 | Forward slew limit; 0 permits no frame-to-frame change after the first frame. |
| Minimum / Maximum pitch Hz | 75 / 600 | Used by Harmonicity and Manipulation pitch analysis. |
| Downsample_factor | 6 | Analysis-only sample-rate reduction; must leave rate > 2 × pitch ceiling. |
| Skip_windowing | Off | Skip the Hann window in HFD analysis. |
Final smoothing and slew limit
After the final moving average, the script scans forward and limits each frame's difference from the already-limited previous frame to this amount.
DurationTier & resynthesis
The final command values are written into a zero-based DurationTier at time 0, every frame centre, and the source end. Praat linearly interpolates between these points.
The script asks the tier for its predicted target duration before rendering. Conceptually, the target duration is the area under the relative-duration curve.
For every input channel:
- Extract that channel and shift it to start at 0.
- Create a Manipulation with 10 ms time step and the selected pitch bounds.
- Replace its DurationTier with the shared HFD tier.
- Use
Get resynthesis (overlap-add).
The independently warped channels are then combined back in channel order. This produces one common temporal deformation while preserving the multichannel layout.
Visualization
The v2.4 Picture view follows the processing chain rather than presenting a generic analysis dashboard:
- Original / Warped output: side-by-side waveforms using one shared amplitude scale.
- Signal complexity (HFD): amber; light = raw, dark = smoothed; fixed 1–2 vertical axis.
- Time-warp command: red; light = raw mapped/gated command, dark = final smoothed and slew-limited command. A 1× reference line is shown.
- Voicing gate: green, shown only when enabled.
- Summary: source/output duration, HFD range, active-frame count, mapping curve and slew rate.
The source and result waveforms use the same amplitude range, so their displayed level difference is meaningful.
Output behavior
- Channel count: preserved.
- Output time domain: zero-based.
- Name:
<source>_HFDwarp_<preset>. - Pitch: the DurationTier changes time while Manipulation overlap-add aims to retain the original pitch contour.
- Duration: determined by the interpolated DurationTier, not simply by multiplying source duration by one nominal preset factor.
Peak safety
After resynthesis the script measures the Sinc70 absolute peak. It attenuates only when that peak exceeds 0.95:
This is an attenuate-only safety ceiling. Quiet output is not normalized upward.