Doppler Effect Simulator
Watch expanding wavefronts bunch up ahead of a moving source and stretch out behind it, drag the listener anywhere, and hear the pitch actually shift. Push the source past Mach 1 to form a shock cone.
Emitted f
440 Hz
Received f′
440 Hz
Shift
0 Hz
Shift %
0.0%
Mach number
0.55
Drag the yellow ring to move the listener.
Motion mode
Sound is off until you press Enable sound — browsers block audio that starts on its own. The oscillator frequency is then driven directly by the computed f′.
How the picture is built
Nothing in this simulation is drawn pre-squashed. Every 1/rate seconds the source emits a new circular wavefront from wherever it happens to be at that instant. Once emitted, that circle expands at the wave speed c around its own fixed birthplace — the medium does not care that the source has moved on.
The classic pattern falls straight out of that construction. Because each new circle is born a little further forward, the circles pile up ahead of the source (short wavelength, high pitch) and spread apart behind it (long wavelength, low pitch). The wave speed never changes; only the spacing does. That is the entire Doppler effect in one sentence.
The source dot turns red while it is approaching the listener and green while it is receding, judged by the component of its velocity along the dashed source-to-listener line — not by which side of the screen it is on. Drag the listener off the flight path and you will see the shift collapse toward zero at the moment of closest approach, when the velocity is purely sideways.
The equation, and why source and observer are not symmetric
The general non-relativistic Doppler formula for sound is:
- f — frequency emitted by the source, in Hz. A property of the source alone; it never changes.
- f′ — frequency actually received by the observer, in Hz.
- c — speed of the wave in the medium (about 343 m/s for sound in 20 °C air). Fixed by the medium, not by the source.
- v_o — observer's speed toward the source, positive when closing.
- v_s — source's speed toward the observer, positive when closing.
When motion is not head-on, only the component along the line joining the two counts: use v·cos θ, where θ is the angle between the velocity and that line. This simulator does exactly that every frame, which is why a source passing to one side produces a smooth glide rather than an instant jump.
The asymmetry. Notice that v_o is in the numerator and v_s is in the denominator. They are not interchangeable, and the reason is physical: a moving source changes the wavelength — it actually crowds the crests together in space, so λ′ = (c − v_s)/f. A moving observer leaves the wavelength alone and instead changes the rate at which they sweep through unchanged crests, so the relative wave speed becomes c + v_o and f′ = (c + v_o)/λ. Different mechanisms, different algebra.
Check it numerically. With c = 343 m/s and f = 500 Hz, a source approaching at 30 m/s gives 500 × 343/313 = 547.9 Hz. An observer approaching a stationary source at the same 30 m/s gives 500 × 373/343 = 543.7 Hz. Same relative speed, different answer — about 4 Hz apart. The gap grows fast as speeds approach c, and vanishes only in the limit v ≪ c.
For light there is no medium, so "who is moving" has no absolute meaning. The relativistic Doppler formula depends only on relative velocity: f′ = f·√((1 − β)/(1 + β)) for recession, with β = v/c. That formula is symmetric by construction, and it also predicts a transverse Doppler shift — a redshift even for purely sideways motion, caused by time dilation — which has no acoustic counterpart at all.
Worked numbers: an ambulance passing you
Take a real siren at f = 700 Hz, an ambulance at 25 m/s (90 km/h, about 56 mph), and c = 343 m/s. You are standing on the pavement, stationary, so v_o = 0 and only the denominator moves.
| Moment | v_s toward you | f′ | Shift |
|---|---|---|---|
| Far away, driving straight at you | +25 m/s | 700 × 343/318 = 755.0 Hz | +55.0 Hz (+7.9%) |
| Approaching at 60° off the line | +12.5 m/s | 700 × 343/330.5 = 726.5 Hz | +26.5 Hz (+3.8%) |
| Level with you (closest approach) | 0 | 700 Hz | none |
| Driving straight away | −25 m/s | 700 × 343/368 = 652.4 Hz | −47.6 Hz (−6.8%) |
The total swing you hear is 755.0 → 652.4 Hz, a drop of about 103 Hz — roughly a musical minor third (a frequency ratio of 1.157, versus 1.189 for an exact tempered minor third). That is why the fly-by sounds like a definite melodic fall rather than a vague blur.
Two details worth noticing. First, the rise and the fall are not equal: +55.0 Hz up but only −47.6 Hz down, because c − v and c + v are not symmetric about c. Second, the transition is fast but not instant — the pitch slides through the whole range in the second or two around closest approach, which is exactly the swoop your ear recognises.
Mach 1 and the sonic boom
Push the speed slider past Mach 1 and the same wavefront construction produces something qualitatively new. Below Mach 1, the source stays inside every circle it has emitted. At exactly Mach 1 it keeps pace with its own leading wavefront, so all the crests pile onto a single plane directly ahead. Above Mach 1 it outruns its own sound, and the circles it left behind have a common tangent line — a cone in three dimensions.
The geometry is simple trigonometry. In time t a wavefront has grown to radius c·t while the source has travelled v·t. The half-angle θ between the cone surface and the flight path satisfies:
sin θ = c·t / v·t = c / v = 1 / M
M = v / c (Mach number)
M = 1.0
θ = 90°
M = 1.2
θ = 56.4°
M = 1.5
θ = 41.8°
M = 2.0
θ = 30.0°
M = 3.0
θ = 19.5°
M = 5.0
θ = 11.5°
Faster means a narrower, more swept-back cone. The Doppler formula itself breaks at M = 1: the denominator c − v_s hits zero and f′ diverges, which is the mathematical signature of every crest arriving simultaneously. Past that point the formula returns a negative frequency, which is the equation's way of saying the waves now arrive in reverse emission order — the shock front first, everything else behind it.
A sonic boom is not a one-off bang at the moment of breaking the sound barrier. The cone trails the aircraft continuously for as long as it flies supersonically, sweeping across the ground like an invisible wake. You hear a boom when the cone reaches you. A jet at Mach 2 and 12 km altitude drags a boom carpet tens of kilometres wide beneath its whole route.
The same construction explains a Cherenkov cone in optics — a charged particle moving faster than light's phase speed in a medium (never faster than c in vacuum) emits a blue optical shock cone with the identical cos θ = 1/(nβ) geometry, which is what makes reactor pools glow blue.
Where the Doppler shift is actually used
- Doppler weather radar: the radar transmits a pulse and measures the frequency shift of the echo from raindrops. Because the wave makes a round trip, the shift doubles: Δf = 2·v_r·f/c. It maps radial velocity, so it sees rotation inside a thunderstorm — the tell-tale "velocity couplet" of adjacent inbound and outbound returns that flags a mesocyclone, and is how tornado warnings get issued minutes before touchdown.
- Police speed guns: the same 2·v·f/c round-trip formula, at X, K, or Ka band. A 34.7 GHz Ka-band gun aimed at a car doing 30 m/s sees a beat frequency of about 6.9 kHz — conveniently in the audio range, which is why the early analogue units simply played it to the officer. Cosine error is the catch: aim off-axis by angle θ and you measure v·cos θ, always under-reading, never over.
- Medical Doppler ultrasound: a few MHz transmitted into tissue, shifted by moving red blood cells. Blood at 50 cm/s with a 5 MHz probe at a 60° insonation angle gives roughly 1.6 kHz of shift — again audible, which is why fetal Dopplers whoosh. Colour Doppler paints flow toward the probe red and away blue, and the 60° limit exists because cos θ error explodes as the beam approaches perpendicular.
- Astronomical redshift: absorption lines in a galaxy's spectrum sit at known laboratory wavelengths, so their displacement gives z = Δλ/λ₀. Radial velocity wobbles of a few m/s in a star's spectrum reveal orbiting exoplanets. Here you must use the relativistic formula — and for distant galaxies the shift is not a velocity through space at all but cosmological expansion stretching the wavelength in transit, a different mechanism that happens to share the arithmetic at low z.
- GPS and satellite links: a satellite in low Earth orbit sweeps several kilohertz of Doppler across a pass at L-band. Receivers must search that shift to lock on — and it is also how the original Transit system worked in reverse, fixing a ship's position from the Doppler curve of a single satellite pass.