Doppler Effect Simulator — User Guide
Straight-line moving-source Doppler processing for pitched audio, with optional inverse-distance amplitude cue, channel-preserving PSOLA resynthesis, presets, and diagnostic visualization.
What this does
Doppler Effect Simulator applies a time-varying pitch trajectory derived from a source moving at constant speed along a straight path past a stationary listener. The user controls source speed, closest-approach distance, and the time of closest approach. A separate optional gain curve can attenuate the signal with distance.
The pitch trajectory is calculated from the classical moving-source Doppler ratio and applied with Praat Manipulation / overlap-add resynthesis. Pitch is analysed once from a mono reference; the resulting target PitchTier is then used to resynthesize every original channel independently, so the output keeps the source channel count and channel order.
Quick start
- Select exactly one Sound object in Praat.
- Run
Doppler_Effect_Simulator.praat. - Choose a preset or leave Custom.
- For Custom, set Speed_m_s, Closest_distance_m, and Time_at_closest_s.
- Choose whether to apply the distance-based amplitude cue and whether to normalize the final peak.
- Set the pitch-analysis range so it brackets the source F0.
- Enable or disable visualization and playback, then run the script.
Motion & Doppler model
The model uses a stationary listener and a source moving at constant speed v along a straight path whose perpendicular distance from the listener is d. The source reaches its closest point at t_c.
Before closest approach, x < 0, so radial velocity is negative and the factor is above 1. After closest approach, radial velocity is positive and the factor is below 1. At the closest point the radial component is zero and the factor is 1.
Amplitude cue
When Apply_amplitude_cue is enabled, every sample and every channel is multiplied by:
This is an inverse-distance amplitude/pressure cue normalized to 1 at closest approach. It is not an inverse-square amplitude law: acoustic intensity is proportional to the square of pressure, while pressure amplitude in free-field spherical spreading follows approximately 1/r.
Processing pipeline
- Validate: speed must be non-negative and below 343 m/s; closest distance must be positive; closest time must lie inside the Sound; pitch bounds must be ordered;
Max_pitch_Hzmust be below Nyquist. - Mono analysis reference: multichannel input is converted to mono only for pitch analysis. Mono input is copied.
- Pitch analysis: Praat
To Pitchuses automatic time step (0.0) and the user-supplied pitch bounds. - Doppler target tier: every 10 ms, plus the exact Sound end time, the detected F0 is multiplied by the Doppler factor.
- Sampling-safe target limit: target F0 values are limited to
20 Hz … 0.45 × sample rate. The Info window reports how many control points were limited. - Per-channel resynthesis: each original channel gets its own
Manipulationobject, receives the same target PitchTier, and is resynthesized with overlap-add. - Recombine: resynthesized channels are combined in source channel order.
- Amplitude cue: if enabled, the
d/rgain curve is applied identically to all channels. - Normalization: if enabled and the result is non-silent,
Scale peak: 0.99performs target peak normalization.
Presets
Presets replace only the three motion parameters: speed, closest distance, and closest time. They do not override amplitude cue, normalization, visualization, playback, or pitch-analysis bounds.
| Preset | Speed | Closest distance | Closest time |
|---|---|---|---|
| Fast Car (City Street) | 15 m/s | 4 m | Sound midpoint |
| Jet Flyover (High Altitude) | 250 m/s | 100 m | Sound midpoint |
| Ambulance Passing (Close) | 20 m/s | 2 m | Sound midpoint |
| Slow Bicycle | 5 m/s | 1 m | Sound midpoint |
| Sci-Fi Warp (Extreme) | 340 m/s | 0.5 m | Sound midpoint |
Parameters
| Parameter | Default | Meaning |
|---|---|---|
| Preset | Custom | Select Custom or one of five motion presets. |
| Speed_m_s | 25.0 | Constant source speed in m/s. Must satisfy 0 ≤ speed < 343. |
| Closest_distance_m | 5.0 | Perpendicular source-listener separation at closest approach; must be greater than 0. |
| Time_at_closest_s | 0.5 | Seconds from Sound start to closest approach; must lie within the Sound duration. |
| Apply_amplitude_cue | Yes | Apply the normalized inverse-distance gain d/r. |
| Normalize_output | Yes | Target-normalize a non-silent final result to peak 0.99. |
| Visualize | Yes | Draw the spatial schematic, Doppler-factor curve, gain curve, and summary. |
| Play | Yes | Play the final Sound after processing. |
| Min_pitch_Hz | 75 | Lower bound for Praat pitch analysis. |
| Max_pitch_Hz | 600 | Upper bound for Praat pitch analysis; must also be below Nyquist. |
Channels & output
- Channel count: preserved. Mono stays mono; stereo stays stereo; multichannel input keeps its number and order of channels.
- Pitch analysis: performed once on a mono reference.
- Pitch target: the same mono-derived Doppler target PitchTier is used for every channel.
- Resynthesis: each source channel is processed independently before recombination.
- Amplitude cue: when enabled, the same gain trajectory is applied to every channel.
- Duration: the overlap-add resynthesis follows the original Sound time domain; no DurationTier is used.
- Sample rate: the final resynthesized output remains at the source sampling frequency.
- Output name:
<source>_Doppler.
Visualization
When Visualize is enabled, the Picture window contains three diagnostic panels plus text summaries.
Spatial schematic
The top panel shows start, closest approach, end, listener position, direction of motion, and the closest-distance marker. Its horizontal coordinate is the Sound's time axis; it is a schematic of the pass-by sequence, not a spatial plot in meters.
Doppler factor
The middle panel plots c/(c + v_radial). A dashed line at 1 marks no pitch shift. Values above 1 occur while approaching and values below 1 while receding.
Gain
The lower panel plots the theoretical d/r gain trajectory with a maximum of 1 at closest approach. This diagnostic curve is drawn even when Apply_amplitude_cue is disabled; in that case it shows the available distance cue rather than an applied amplitude transformation.
Summary
The figure also reports the preset, speed, closest distance, expected approach/recede shift, and a compact summary strip. Detailed run parameters and any sampling-safety pitch limiting are reported in the Info window.