Lesson 8 of 15
Doppler Effect
The Doppler Effect
When a sound source moves toward you, successive wavefronts are compressed — the frequency you hear is higher. Moving away stretches them — the frequency is lower.
f_ ext{obs} = f_0 cdot rac{v}{v - v_s}
- — emitted frequency (Hz)
- m/s — speed of sound
- — source velocity (m/s): positive = moving toward observer
Sign Convention
| Effect | |
|---|---|
| > 0 | source approaching — higher pitch |
| = 0 | source stationary — unchanged |
| < 0 | source receding — lower pitch |
Examples ( Hz)
| (m/s) | (Hz) |
|---|---|
| 0 | 440.0000 |
| 34.3 ( Mach 0.1) | 488.8889 |
| −34.3 | 400.0000 |
Your Task
Implement dopplerShift(f0, vSource) returning the observed frequency ( m/s).
Run the code to hear the Doppler shift — ascending then descending pitch.
Web Audio API loading...
Loading...
Click "Run" to execute your code.