Temporal Warping — User Guide

Align, stretch, or compress speech and musical phrases in time using dynamic temporal mapping functions.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 1.0 (2025) License: MIT License
Contents:

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.

Design: This documentation maintains your signature clean visual style for the plugin set (same spacing, typography, and components).

Quick start

  1. Load a Sound or Pitch object in Praat.
  2. Run Run script… and select Temporal_Warping.praat.
  3. Choose Warping mode: manual (control points) or from anchor file.
  4. Define mapping pairs: original time → warped time.
  5. Apply to desired object(s). The script resamples or interpolates as needed.
Tip: You can also export the warping curve as a TableOfReal for reuse in other scripts.

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.

TypeDescriptionUse case
LinearPiecewise-linear mapping between defined anchor points.Simple tempo alignment.
SplineSmooth continuous curve preserving monotonicity.Gradual accelerando/ritardando.
DynamicDerived 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

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

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.