How to use the Doppler effect calculator
The calculator opens in Simple mode, set to the "Car horn approaching" preset.
- Pick a mode. Simple is for sound with a stationary listener in still air. Advanced adds a listener velocity, an adjustable speed of sound, and a Wave model selector with "Sound" and "Light in vacuum."
- Enter the emitted frequency. This is the frequency of the wave as the source produces it. The field accepts 0.01 Hz to Hz, and scientific notation works, so
6e14means 600 THz. - Enter the velocities. Positive means moving toward the other participant, negative means moving away.
- Read the result. "Observed frequency" is the main output, in hertz. Advanced mode also shows the signed "Frequency shift" as a percentage. Light mode adds "Observed wavelength." A label tells you whether the result is a higher pitch, lower pitch, blueshift, redshift, or no frequency shift.
Simple mode
Simple mode assumes a stationary listener and a fixed sound speed of 343 m/s, roughly the speed of sound in air at 20 °C. It has two controls: "Emitted frequency (Hz)" and "Source velocity (m/s)."
The "Try an example" menu has three entries:
- Car horn approaching: 400 Hz at +49 m/s (the opening state).
- Car horn receding: 400 Hz at −49 m/s.
- Custom values: selected automatically as soon as you edit either control.
Advanced mode, Sound
Advanced Sound keeps the emitted frequency and source velocity and adds:
- Listener velocity (m/s): starts at 0.
- Speed of sound (m/s): starts at 343. Enter the value for your medium and conditions, such as warmer air, helium, or water.
Advanced mode, Light in vacuum
Light mode has one motion input, "Relative velocity (% of light speed)," starting at +60. Type 60 for 60% of the speed of light, not 0.6. Switching from Sound to Light keeps your current emitted frequency. The sound-only velocity and speed-of-sound controls become inactive.
Accepted ranges
| Input | Typed range | Slider |
|---|---|---|
| Emitted frequency | 0.01 to Hz | Logarithmic: about 20 Hz to 20 kHz for sound, 0.01 to Hz for light |
| Source velocity | −4,000 to +4,000 m/s (must stay subsonic) | −100 to +100 m/s, 1 m/s steps |
| Listener velocity | −4,000 to +4,000 m/s (must stay subsonic) | −100 to +100 m/s, 1 m/s steps |
| Speed of sound | 1 to 10,000 m/s | 100 to 2,000 m/s, 1 m/s steps |
| Relative light velocity | −99.9% to +99.9% of | 0.1 percentage-point steps |
Typed values can be decimals even where the slider moves in whole steps. In Simple mode, sound frequency can be typed anywhere in the full supported range, not only in the slider's 20 Hz to 20 kHz span. If an input is invalid, the field is highlighted and the result shows an em dash until you correct it.
The Doppler effect formula for sound
The calculator uses the standard classical model for a wave travelling through a stationary medium. Define:
- : speed of sound in the medium (m/s)
- : signed source velocity (m/s)
- : signed listener velocity (m/s)
- : emitted frequency (Hz)
Both velocities are measured relative to the medium. Each is positive when that participant moves toward the other and negative when moving away.
The Doppler factor is
and the observed frequency is
The signed percentage change in frequency is
A positive result means a higher pitch. A negative result means a lower pitch. Zero means no shift.
The doppler effect equation and sign conventions
Textbooks often write this equation with symbols, which makes sign errors easy. This page avoids that by giving every velocity one rule: positive toward the other participant, negative away.
| Situation | ||
|---|---|---|
| Source moves toward listener | positive | |
| Source moves away from listener | negative | |
| Listener moves toward source | positive | |
| Listener moves away from source | negative |
With this rule you can use the same equation for every case and let the signs carry the direction. The formula is not symmetric: a moving source and a moving listener with the same speed produce different shifts, because they act on different parts of the wave.
Why source motion and listener motion differ
Sound waves travel at speed relative to the medium, no matter how the source moves.
- Source motion changes the wavelength. While emitting each cycle, a source moving toward you advances slightly, so successive crests are released closer together. The crest spacing on the listener's side is meters. A receding source stretches that spacing.
- Listener motion changes the arrival rate. A listener moving into the waves meets crests faster, at a closing speed of . The crests arrive at a rate of divided by the crest spacing, in crests per second. Moving away from the source meets them more slowly.
Dividing the closing speed by the crest spacing gives the observed frequency:
which is the same formula as above. This is why changing the listener velocity in the diagram does not change the wavefront spacing, but it does change the crossing rate.
Model assumptions and limits
The sound model assumes:
- a homogeneous, stationary medium;
- a direct propagation path between source and listener;
- constant velocities along the line joining them.
Both and must be strictly less than . Reflected paths, off-axis motion, and sonic booms are outside the model. If either participant reaches or exceeds the speed of sound, the calculator reports an input error.
Doppler effect examples for sound
Example 1: car horn approaching and receding
The preset horn has Hz and a speed of 49 m/s (about 176 km/h), with m/s and a stationary listener.
Approaching ( m/s):
Receding ( m/s):
The horn sounds about 67 Hz higher on approach and 50 Hz lower on departure. The two shifts are not equal and opposite, because the denominator changes in both directions. This asymmetry is part of what makes the car horn a classic Doppler effect example.
In a drive-by where the car passes at a distance, the pitch glides from high to low. The angle between the car's velocity and the line to you changes as it passes. The calculator models the straight-line approach and recession, which are the two cases in the presets.
Example 2: an ambulance siren
A siren emits 700 Hz and approaches a stationary listener at 25 m/s, with m/s.
After it passes, m/s:
Example 3: a moving listener
A speaker at rest emits 500 Hz. A listener moves toward it at 20 m/s (, ).
The crest spacing stays m. The listener meets crests at per second, matching the formula.
Example 4: a different medium
Set the speed of sound to 1,480 m/s, a typical value for water, then enter a 1,000 Hz source approaching at 10 m/s:
The same 10 m/s produces a much smaller shift than in air because the speed ratio is far smaller. For small speeds, the shift is close to .
Moving at the same velocity
If source and listener both move with velocity toward each other, the shifts add up: . If they move with equal and opposite signed velocities, such as and , then and the shift is zero. In a real scenario this means both are moving in the same direction at the same speed, so the separation does not change.
Speeds close to the speed of sound
The factor in the denominator shrinks as the source speed approaches , so the shift grows rapidly. At m/s:
| (m/s) | |
|---|---|
| 320 | |
| 321 |
A 1 m/s change in the input, only 0.3% of the speed, changes the result by about 4.5%. For this reason, valid inputs where either participant's speed reaches 90% of the sound speed trigger a warning. Check that your speeds are measured relative to the medium, not the ground, since wind changes the answer.
The calculator preserves small differences near the sonic limit before rounding. Even so, an entry that is technically subsonic can fail with a precision error if intermediate quantities (the speed differences, the Doppler factor, the observed frequency, or the crest spacing) become smaller than the smallest positive normal double-precision number, about , or if the observed frequency or shift is not finite.
The relativistic Doppler effect for light
Light needs a different formula. It has no medium, and the speed of light is the same for every observer. The calculator uses the longitudinal relativistic Doppler effect for light in a vacuum, where the source and observer move along the line of sight at constant relative velocity.
Let be the relative velocity entered as a percentage of the speed of light, so . Positive means approach and negative means recession. The speed of light is the exact value m/s.
The percentage change in frequency is . The calculator evaluates the equivalent expression
which keeps very small shifts accurate where subtracting two nearly equal numbers would lose precision.
Wavelengths follow from :
Multiply by to convert meters to nanometers.
Approach gives a higher frequency and shorter wavelength, a blueshift. Recession gives a lower frequency and longer wavelength, a redshift. With zero relative velocity, the emitted and observed values are equal. When the relative speed is small compared with , the fractional frequency shift is approximately .
Unlike sound, the light formula has no separate source and observer terms. Only the relative velocity matters, so there is a single input. The model excludes transverse motion, propagation through a material, reflections, gravitational redshift, and cosmological expansion.
Example 5: blueshift
Take light with Hz and a relative approach speed of 20% of (, ).
Example 6: redshift
Using the same source with ():
The observed wavelength is now in the infrared. Notice that . The approaching and receding factors are reciprocals, unlike the sound case.
How to read the results and the diagram
Result display
- Observed frequency is always shown in Hz. Two decimals are typical.
- Frequencies from 0.01 Hz up to but not including 1 Hz keep up to five significant digits.
- Nonzero values below 0.01, or values of at least 100,000, are shown in scientific notation with five significant digits, such as
6.1237e+14. - Frequency shift is a signed percentage shown in Advanced mode. A very large negative shift that would display as −100.00% appears as "≈ −100%."
- Observed wavelength appears only in Advanced Light in vacuum. It is shown in nm for values from m up to but not including m, and in meters otherwise.
Sound diagram (a Doppler effect simulation)
The sound diagram updates as you move the controls. It draws circular wavefronts, marks their spacing on the listener's side, and shows the crest crossing rate at the listener. Try these experiments:
- Raise the source velocity and watch the wavefronts bunch up ahead of it.
- Reverse its sign to see them spread out.
- Change only the listener velocity. The wavefront spacing stays fixed while the crossing rate changes.
Light diagram
The light diagram compares emitted and observed wavelengths as bars on a common scale. A shorter observed bar means blueshift, and a longer one means redshift. Both diagrams are visual aids only and have no audio playback.
Verify the calculator yourself
You can check any result with a pocket calculator.
- Choose , , , and .
- Compute .
- Multiply and compare it with "Observed frequency."
- Compute and compare it with "Frequency shift."
For light, compute , then , then and .
Useful checks you can reproduce:
- 400 Hz with the approaching and receding presets gives 466.67 Hz and 350.00 Hz.
- In Advanced Sound, with m/s and m/s, the result is 533.33 Hz, +33.33%.
- In Advanced Light in vacuum, Hz with gives Hz, −50.00%, and 999.31 nm.
Common mistakes
- Wrong sign. Positive means toward the other participant. A receding source needs a negative velocity.
- Entering 0.6 instead of 60. Light velocity is a percentage of .
- Using ground speed in wind. Sound velocities are relative to the air, not the ground.
- Using the 343 m/s default for another medium. Switch to Advanced and enter the actual speed of sound.
- Applying the sound formula to light. Sound has a medium, so source and listener motion differ. Light uses only the relative velocity.
- Treating a drive-by as straight-line motion. Only the velocity component along the line of sight counts, and that component changes as the vehicle passes.
Copy, export, reset, and help
- Copy places the active inputs and results on your clipboard.
- Export opens your browser's print dialog, where you can print or save a PDF.
- Reset restores Simple mode, the approaching horn preset, and the initial Advanced values.
- Help explains presets, signs and units, switching wave models, reading the diagram, and saving or resetting.
Frequently asked questions
What is the Doppler effect?
It is the change in the observed frequency of a wave when the source and observer are in relative motion. Sound from an approaching source has a higher pitch, and from a receding source a lower one. Light from an approaching source shifts toward blue and from a receding source toward red.
What is the formula for the Doppler effect?
For sound, , with velocities positive toward the other participant. For light in a vacuum, , where is the relative velocity divided by .
Why is the shift different for approach and recession?
For sound, the source velocity appears in the denominator, so and do not change by the same proportion. For light, approach and recession factors are reciprocals.
Does it matter whether the source or the listener moves?
For sound, yes. A moving source changes the crest spacing, and a moving listener changes the arrival rate, so the shifts differ even at the same speed. For light, only the relative velocity matters.
Why does the calculator reject speeds equal to the speed of sound?
The sound model requires both speeds to stay below in magnitude. At , the denominator reaches zero. At , the listener moves with the crests and the crossing rate reaches zero. The calculator excludes all sonic and supersonic cases for both participants.
Can the calculator handle light in a material like glass or water?
No. The light model is for a vacuum. Propagation in a material, transverse motion, gravitational redshift, and cosmological expansion are excluded.
Does it play the sound?
No. The diagrams are visual only and have no audio playback.
Read the formula definitions, supported input ranges, and limitations before using this estimate.