The idea: each front starts where the source was
A sound source pushes the air once per period T = 1/f. Each push sends out a wavefront: a circle (a sphere in 3-D) that grows at the speed of sound v = 343 m/s. The circle grows from the point where the source was when it sent that front. The source may move on, but the front does not care: it belongs to the air, not to the source.
If the source stands still, all circles share one centre and are λ = v/f apart in every direction. If the source moves at vs, each new circle starts a little further along. The fronts ahead are squeezed and the fronts behind are stretched. This is the Doppler effect. On the page one frame is 1/343 s, so sound moves exactly 1 m per frame.
Why f' = f·v/(v ∓ vs)
In one period T the front ahead moves v·T, but the source chases it and covers vs·T. So the next front starts only (v − vs)·T behind it. A listener ahead meets those fronts at speed v, one every (v − vs)·T / v seconds. One over that is the pitch it hears:
ahead: f' = f · v / (v − vs) behind: f' = f · v / (v + vs)
For f = 343 Hz (the numbers the page shows; the menu gives vs as a part of v):
| vs | spacing ahead | A hears (ahead) | spacing behind | B hears (behind) |
|---|---|---|---|---|
| 0 | 1 m | 343 Hz | 1 m | 343 Hz — Demo 1 |
| 0.25 v = 85.75 m/s | 0.75 m | 457.33 Hz | 1.25 m | 274.4 Hz — Demo 2 |
| 0.5 v = 171.5 m/s | 0.5 m | 686 Hz | 1.5 m | 228.67 Hz |
| 0.75 v = 257.25 m/s | 0.25 m | 1372 Hz | 1.75 m | 196 Hz — Demo 4 |
The page checks this the hard way too: it works out when each front reaches A and B, and the gap between the last two arrivals gives the pitch heard (the ✓ in the listener panels). A higher f only shrinks the whole pattern: at 686 Hz and vs = 0.5 v, A hears 1372 Hz and B 457.33 Hz, still the same ratio (Demo 8).
An ambulance passing
Stand on the road and let the source drive through you (Demo 3, A at 11 m). While it comes, the fronts reach you squeezed: 457.33 Hz. The moment it passes, the fronts come from the other side, stretched: 274.4 Hz. On the line of motion the pitch jumps. Standing beside the road, you hear f·v/(v − vs·cos θ), where θ is the angle between the source's path and your direction, so the pitch slides down smoothly as θ goes from 0 to 180°. A real ambulance is slower (about 30 m/s, about 10% higher); the page uses 85.75 m/s to make the bunching easy to see.
A moving listener
Now the source stands still and the listener walks into the fronts at vL. The fronts are still λ apart, but the listener meets them at v + vL instead of v, so f' = f·(v + vL)/v (walking away: f·(v − vL)/v). At vL = 0.5 v, A hears 343 · 1.5 = 514.5 Hz (Demo 7). With both moving toward each other the two effects multiply: f' = f·(v + vL)/(v − vs). The formulas are not symmetric: a source moving at 0.5 v toward you gives ×2, a listener moving at 0.5 v gives only ×1.5. What counts is the motion relative to the air.
At the speed of sound: the sonic boom
At vs = v the spacing ahead (v − vs)·T is zero. Every front starts exactly at the edge of the older ones, and they all touch at the source: a thin wall of high pressure, a shock wave. A listener ahead hears nothing, then all the fronts at once (in Demo 5, 23 fronts reach A together at t = 22 frames): the sonic boom. Behind, B still hears f·v/(2v) = 171.5 Hz.
Faster than sound: the Mach cone
At vs > v the source outruns its own sound. In a time t the oldest front has radius v·t, while the source has gone vs·t. The lines from the source that touch all the circles form the Mach cone, with half-angle α:
sin α = v·t / (vs·t) = v / vs = 1 / M (M = vs / v, the Mach number)
At M = 1.5 (Demo 6), sin α = 0.667 and α ≈ 41.81°. Ahead of the cone the air is silent; when the cone sweeps over you, you hear the boom, and only then the sound the source made earlier. The faster the plane, the narrower the cone.
Light: red shift and blue shift
Light shows a Doppler effect too, but light needs no air: only the speed of the source relative to the observer counts, and the formula comes from relativity, f' = f·√((1 + β)/(1 − β)) for a source coming toward you at β = u/c. A star moving away looks a little redder (red shift), one moving toward us a little bluer (blue shift). The light from far galaxies is red-shifted, which is how we know the universe is expanding. Police radar and Doppler weather radar use the same idea with radio waves.
See also
The wavefront circles are the same crests as in Wave Interference: Two Coherent Sources, where two still sources make bright and dark lines. The source itself is a vibrating object, like the mass in Spring Oscillator: its frequency f is what the Doppler effect shifts.
What the page leaves out
Listeners off the line of motion (the angle θ, the smooth slide in pitch), wind (a moving medium shifts both v's), echoes and the ground, the loudness falling off with distance, the source speeding up or slowing down, the shape of a real N-wave sonic boom, the cone in 3-D, and the relativistic formula for light. The page keeps v = 343 m/s (air at 20 °C), shows 32 m of road and at most 24 frames (70 ms), and lets only listener A walk.