An ambulance races toward you and its siren sings high. The moment it passes, the pitch drops, though the driver hears the same steady note the whole time. Nothing about the siren changed. What changed is how the sound reaches you.
A siren sends out sound crests at a steady rate, say 700 a second. Each crest leaves the siren and then travels on at the speed of sound, about 343 metres per second in air at 20 °C, no matter how fast the siren moves. But the siren is moving. Each new crest starts a little closer to you than the last, so the crests ahead of the vehicle are bunched up. Behind it they are stretched out.
Your ear counts crests per second. Bunched crests arrive more often, so you hear a higher pitch. Stretched crests arrive less often, so you hear a lower one. Pitch is nothing more than crests per second.
Drag left and right across the canvas to change the speed, or use the sliders. The rings are sound crests, each one centred where the source was when it made that crest. The listener sits on the right.
Try 343 m/s: the crests pile up into a wall in front. Go beyond it and they form a cone.
For a source moving toward a still listener at speed v, the heard frequency is the original frequency times c divided by (c − v), where c is the speed of sound. Moving away, it is c divided by (c + v). At 120 m/s, a 700 Hz siren is heard at about 1,077 Hz ahead and about 519 Hz behind. That gap is more than an octave.
Notice what happens as v approaches c. The bottom of the fraction heads to zero and the pitch shoots up. Crests no longer get out of the way of the source. They pile on top of each other.
Once the source outruns its own sound, every crest is left behind. The rings still spread, but the source stays ahead of all of them, and the circles line up along two edges of a cone. Along that edge, crests from many moments arrive together, which you hear as one sharp crack, a sonic boom. The cone's half-angle follows a simple rule: its sine equals one over the Mach number. At Mach 2 that angle is 30 degrees.
The boom is not a single event at the moment of breaking the sound barrier. The cone sweeps along the ground, and everyone it crosses hears the boom as it passes.
Christian Doppler proposed the idea in 1842 for light from stars. It was tested for sound in 1845 by the Dutch scientist Buys Ballot, who put trumpeters on an open railway carriage and had trained musicians on the platform judge the pitch as it passed. The pitch fell as the train went by, just as predicted.
The same idea is behind police radar and weather radar, which compare the frequency of a reflected wave with the one sent. Astronomers use it too: light from a galaxy moving away is shifted toward red, and the size of that shift tells them how fast it is receding.
Every wave obeys the same logic. If you move relative to the source, you count crests at a different rate than it makes them. Pitch for sound, colour for light: the siren is just the version you can hear in the street.