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}

  • f0f_0 — emitted frequency (Hz)
  • v=343v = 343 m/s — speed of sound
  • vsv_s — source velocity (m/s): positive = moving toward observer

Sign Convention

vsv_sEffect
> 0source approaching — higher pitch
= 0source stationary — unchanged
< 0source receding — lower pitch

Examples (f0=440f_0 = 440 Hz)

vsv_s (m/s)fextobsf_ ext{obs} (Hz)
0440.0000
34.3 (approxapprox Mach 0.1)488.8889
−34.3400.0000

Your Task

Implement dopplerShift(f0, vSource) returning the observed frequency (v=343v = 343 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.