Temporal Warping — User Guide
Align, stretch, or compress speech and musical phrases in time using dynamic temporal mapping functions.
What this does
The Temporal Warping script performs non-linear time mapping of Sound, Pitch, Intensity, or TextGrid objects in Praat. You can define warp functions to accelerate, decelerate, or synchronize two signals (like dynamic time warping, but customizable). It supports both analytic mappings and control-point-based interpolation curves.
Quick start
- Load a Sound or Pitch object in Praat.
- Run Run script… and select
Temporal_Warping.praat. - Choose Warping mode: manual (control points) or from anchor file.
- Define mapping pairs: original time → warped time.
- Apply to desired object(s). The script resamples or interpolates as needed.
Warping model
Temporal warping is defined by a monotonic function w(t) mapping original time t to warped time. This allows temporal stretching, compression, or non-linear alignment.
Mapping function
w(t) = Σᵢ Bᵢ(t) * Δtᵢ, where Bᵢ are basis splines or linear segments between control points.
The derivative dw/dt indicates local time dilation or contraction.
| Type | Description | Use case |
|---|---|---|
| Linear | Piecewise-linear mapping between defined anchor points. | Simple tempo alignment. |
| Spline | Smooth continuous curve preserving monotonicity. | Gradual accelerando/ritardando. |
| Dynamic | Derived from time alignment of two signals (DTW). | Automatic synchronization. |
Script options
Inputs
- Primary object: Sound, Pitch, or Intensity
- Reference object (optional): target for alignment
- Warp source: manual | anchor file | DTW | formula
Control
- Interpolation: linear | spline
- Resampling rate: Hz
- Anchor smoothing: frames
- Clamp boundaries: yes/no
Output
- Warped Sound or corresponding Pitch/TextGrid
- Warp function Table: time→time mapping
- Warping ratio plot (optional)
Applications
- Speech alignment: Match timing of two utterances (e.g., mimicry studies).
- Performance synchronization: Align sung and spoken versions.
- Tempo normalization: Stretch/compress recordings to a common time grid.
- Expressive timing analysis: Visualize local acceleration/retardation curves.
Examples
1) Manual warp
Define a few anchor pairs manually.
Anchors:
0.00 → 0.00
0.50 → 0.60
1.00 → 1.20
Mode: linear
2) From anchor file
Load a text file with time pairs.
# Anchor file (t_original t_target)
0.0 0.0
1.0 0.9
2.0 2.2
3) Dynamic time warping
Automatically compute mapping between two sounds with DTW, then apply to one of them.
Warp source: DTW
Reference: target Sound
Output: Warped Sound
Troubleshooting
- Warp jumps backward — Ensure anchors are sorted and monotonic.
- Aliasing artifacts — Increase resampling rate or apply spline smoothing.
- Boundary errors — Enable clamp boundaries or extend anchor coverage.
- Misalignment — Check reference object duration; DTW requires similar scale.
FAQ
Can I reverse time?
Yes, but only with explicit negative mapping; typical warps require monotonic increase of time.
Can I apply the same warp to multiple objects?
Yes. Once generated, the Warp function Table can be re-used on other objects with identical duration.
Is this real-time?
No, processing is offline but efficient for up to 10-minute signals.