DEV Community

Cover image for The Doppler Effect: Why a Passing Siren Changes Its Pitch
NovaSolver
NovaSolver

Posted on • Originally published at novasolver.jp

The Doppler Effect: Why a Passing Siren Changes Its Pitch

Stand on a sidewalk as an ambulance races past and you hear something that has nothing to do with the driver touching the siren control. As the ambulance approaches, the tone is high and tense; the instant it passes you, the pitch drops and sags away into the distance. The siren itself never changed. What changed is the relationship between the moving source and your stationary ear.

This is the Doppler effect, and it is one of the most widely useful pieces of wave physics there is. The same principle that bends a siren's pitch lets a radar gun clock a speeding car, lets a weather radar see rain moving inside a storm, and lets astronomers measure how fast distant galaxies are receding. This article explains the mechanism, the formula, and the errors that catch people out.

Why this calculation matters

The Doppler effect turns a frequency measurement into a velocity measurement, and that conversion is everywhere. Police radar and lidar read a vehicle's speed from the frequency shift of a reflected beam. Doppler weather radar maps wind inside a thunderstorm by the shift of the echo from raindrops. Medical ultrasound measures blood flow in an artery the same way, listening for the shift in sound bounced off moving red cells.

Astronomy may be the most dramatic application. The light from a receding galaxy is shifted toward the red end of the spectrum, and the size of that redshift tells us how fast the galaxy is moving away — the observation that revealed the universe is expanding.

In every one of these cases, the analysis depends on predicting, or inverting, the frequency shift correctly. A sign error or a confusion about who is moving turns an approaching object into a receding one. Getting the Doppler formula right is what makes the measurement trustworthy.

The core formula

The Doppler effect arises because a wave's frequency depends on how fast wavefronts arrive at the observer — and motion changes that arrival rate.

When the source moves toward a stationary listener, each successive wavefront is emitted from a point a little closer than the last. The wavefronts bunch up, their effective wavelength shrinks, and the listener hears a higher frequency. When the source moves away, the wavefronts stretch out and the pitch drops.

For a moving source and a stationary observer, the observed frequency f' is:

Source approaching:  f' = f * v / (v - v_s)
Source receding:     f' = f * v / (v + v_s)
Enter fullscreen mode Exit fullscreen mode

Here f is the emitted frequency, v is the speed of the wave in the medium (the speed of sound for an audible siren), and v_s is the speed of the source. Approaching shrinks the denominator and raises the pitch; receding enlarges it and lowers the pitch.

The more general form also accounts for a moving observer:

f' = f * (v + v_o) / (v - v_s)
Enter fullscreen mode Exit fullscreen mode

with v_o positive when the observer moves toward the source and v_s positive when the source moves toward the observer. One subtlety is worth noting: a moving source and a moving observer do not produce identical shifts even at the same relative speed, because it is motion through the medium that matters for sound, not just the closing rate.

When the source speed reaches the wave speed, the denominator goes to zero — the wavefronts pile onto one another and form a shock wave. That is the sonic boom of an aircraft at the speed of sound.

A worked example

An ambulance siren emits a steady tone of f = 1000 Hz and drives directly toward a stationary listener at v_s = 30 m/s. The speed of sound in air is v = 343 m/s. What frequency does the listener hear?

Step 1 — choose the right form. The source is approaching the observer, so the denominator carries a minus sign:

f' = f * v / (v - v_s)
Enter fullscreen mode Exit fullscreen mode

Step 2 — substitute the numbers.

f' = 1000 * 343 / (343 - 30)
f' = 343000 / 313
f' = 1096 Hz
Enter fullscreen mode Exit fullscreen mode

The listener hears a tone of about 1096 Hz — roughly 96 Hz higher than the siren's true 1000 Hz pitch. That shift is easily audible; it is the tense, raised note you register as the ambulance bears down on you.

Step 3 — check the receding case. Once the ambulance passes and drives away, the source recedes, the denominator becomes (v + v_s), and:

f' = 1000 * 343 / (343 + 30) = 343000 / 373 = 919 Hz
Enter fullscreen mode Exit fullscreen mode

So the pitch swings from about 1096 Hz down to about 919 Hz the moment the ambulance goes by — a drop of roughly 177 Hz across the pass. That sudden sag is the unmistakable signature of the Doppler effect.

Common mistakes

Getting the sign wrong in the denominator. Approaching source: subtract v_s. Receding source: add v_s. Swapping the two turns a rising pitch into a falling one. A quick reality check — does the approaching siren come out higher? — catches the error fast.

Treating source motion and observer motion as the same. They sit in different parts of the formula and produce different shifts, because for sound it is motion relative to the air that counts. The two are only approximately equal when the speeds are far below the wave speed.

Using the relative speed instead of the speed along the line of sight. Only the component of velocity directly toward or away from the listener produces a shift. A source moving across your field of view, neither approaching nor receding, produces no first-order Doppler shift at all.

Applying the sound formula to light. The acoustic Doppler formula assumes a medium that the wave travels through. Light needs no medium, and at high speeds the relativistic Doppler formula must be used instead.

Forgetting the speed of sound shifts with temperature. v rises with air temperature, so the same source speed produces a slightly different shift on a hot day than on a cold one.

Try the interactive NovaSolver calculator

Plugging numbers into the formula is easy enough, but hearing the logic click usually takes a picture. The Doppler Effect Simulator on NovaSolver lets you set the source frequency, source velocity, observer velocity, and speed of sound, then reports the observed frequency for both the approaching and receding cases, the Mach number, and the frequency-change ratio — with three views: an animated circular wavefront, a frequency-versus-velocity chart, and a Mach cone for supersonic speeds.

Related calculators

You can browse the rest in the acoustics tools hub.

Closing note

The Doppler effect is a small idea with a long reach: moving wavefronts arrive at a different rate, so motion becomes audible — or measurable. From a passing ambulance to a radar gun to the expansion of the universe, the same handful of relations does the work. Keep the signs straight, remember that source and observer motion are not interchangeable for sound, and use the component of velocity along the line of sight. Do that, and a shift in pitch becomes a precise readout of speed.

Top comments (0)