Doppler Shift Effect — User Guide
A stylized Doppler-inspired time warp whose instantaneous source-read rate controls pitch/time motion and whose separate exponential gain law creates approach/recession-like amplitude trajectories.
What this does
Doppler Shift Effect is a stylized time-warp instrument. It does not solve source/listener positions and the speed of sound. Instead, it directly specifies how quickly the output reads through the source:
The derivative of the source-read position is the instantaneous rate. A rate above 1 reads the source faster and raises pitch; below 1 reads slower and lowers pitch. A second, independent law controls amplitude.
What is the Doppler effect?
The physical Doppler effect is the change in observed frequency caused by relative motion between a wave source and an observer. For sound, an approaching source is heard at a higher frequency and a receding source at a lower one because the spacing of arriving wavefronts changes.
This script borrows the perceptual idea of motion-linked pitch and level, but it implements it as a controllable resampling trajectory. It is therefore more flexible than a physical solver: it can make strictly rising or falling glides, preserve total duration, or deliberately run off the source early.
Quick start
- Select exactly one Sound.
- Run
Doppler_shift.praat. - Choose a preset.
- For a physically intuitive falling glide, use a negative Shift_amount.
- Choose Free traversal for source-exhaustion effects or Duration-preserving to traverse the whole source exactly once.
- Use Edge_guard_ms to avoid hard source/output boundaries.
Presets
| Preset | Base | Shift | Acceleration | Decay |
|---|---|---|---|---|
| Custom | 1.0 | 0.5 | 2 | 15 |
| Passing Car | 1.0 | 0.4 | 2 | 12 |
| Passing Train | 1.0 | 0.3 | 1.5 | 8 |
| Flyby (fast) | 1.0 | 0.8 | 4 | 20 |
| Subtle Approach | 1.0 | 0.2 | 1.5 | 5 |
| Heavy Decay | 1.0 | 0.5 | 2 | 30 |
| Sci-Fi Whoosh | 0.8 | 1.2 | 3 | 25 |
| Reverse Doppler | 1.5 | -0.5 | 2 | -10 |
| Ambulance Siren | 1.0 | 0.35 | 2.5 | 15 |
Presets set the musical trajectory parameters but do not change the selected traversal mode, edge guard, output peak or visualization/playback switches.
Rate law and traversal modes
The source-read position is the integral of the rate law. Two traversal modes choose the normalization constant k.
| Mode | k | Result |
|---|---|---|
| Free traversal | 1 | The source can be consumed before the output ends when the mean rate is greater than 1. The remaining output is closed to zero, with an optional cosine guard. |
| Duration-preserving | Mean raw rate = Base_shift + Shift_amount/(Acceleration+1) | Normalizes the entire rate curve so the read map traverses the source exactly once while preserving the relative glide shape. |
For hearing pitch motion directly, convert rate to semitones:
Distance-like gain
Decay_amount controls a separate exponential amplitude curve:
+Dwith D≥1: gain moves from 1 to1/D.-Dwith |D|≥1: gain moves from1/|D|to 1.0: flat gain.
This is a distance-like ratio law, not inverse-square acoustic propagation. It is intentionally independent from the pitch/time trajectory.
Controls
| Control | Default | Meaning |
|---|---|---|
| Base_shift | 1.0 | Starting raw source-read rate. |
| Shift_amount | 0.5 | Difference added across the file. May be negative, but the entire instantaneous rate must remain above 0.01. |
| Acceleration | 2 | Exponent shaping how quickly the rate moves toward its endpoint. |
| Decay_amount | 15 | Distance-like amplitude ratio law; 0, ≥1 or ≤−1. |
| Rate_mode | Free traversal | Chooses free or duration-normalized source traversal. |
| Edge_guard_ms | 5 ms | 0 = hard boundaries; positive values add short smooth guards at source exhaustion and file edges. |
| Scale_peak | 0.99 | Final target peak. |
| Draw_visualization | On | Draws source-read geometry, glide, gain and measured spectrograms. |
| Play_result | On | Plays the result. |
Channels, interpolation and level
- Multichannel input: the script measures RMS for every source channel and chooses the strongest-RMS channel as the single source. It does not preserve the original stereo/multichannel image.
- Output: mono.
- Duration: always the original duration. Free traversal may become silent before the end if the source is exhausted.
- Sample rate: preserved.
- Interpolation: the object-by-time read uses Praat's linear interpolation. It is not an anti-aliased resampler; rates above 1 can retain a bright/rough high-rate character.
- Final level: every non-silent result is target-normalized to
Scale_peak. - Randomness: none.
Output name: <source>_doppler_<preset>.
Visualization
- A — Source-read geometry: output time mapped to source position, including early source exhaustion in Free mode.
- B — Pitch of the glide: the realized rate in semitones against a physical constant-velocity pass-by scaled to the same semitone span, plus a small plan-view geometry diagram.
- C — Relative gain: distance-like gain and the effective edge/source-exhaustion guard.
- D — Measured spectrograms: source and output spectra over time, framed on the source's own energy so the harmonic sweep is visible.
Historical / technological / compositional context
Christian Doppler proposed the effect that bears his name in 1842. An acoustic test followed in 1845 when Christoph Buys Ballot used musicians on a moving train and listeners beside the track; the approaching and receding pitch differences provided an early experimental confirmation for sound.
Technologically, Doppler shift later became fundamental to radar, sonar, medical ultrasound, astronomy and velocity measurement. In audio and composition, the same perceptual cue is useful even when no literal moving source exists: changing read rate can create a strong impression of approach, recession, fly-by or impossible motion.
This script deliberately belongs to that compositional abstraction. Its trajectory is specified directly rather than derived from meters, source velocity and speed of sound. That freedom allows motions that a physical pass-by would not produce, and the visualization makes the difference explicit instead of presenting the preset names as acoustic simulation.
Further reading
- Physics Today — “The fall and rise of the Doppler effect” — historical account of Doppler's proposal and Buys Ballot's 1845 train experiment.