Doppler Effect Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

How this Doppler effect calculator works

This calculator estimates the frequency heard by an observer when either the source, the observer, or both are moving through a medium such as air. It also includes a live wavefront animation so you can see why the number changes. Instead of treating the Doppler effect as a formula to memorize, the page connects the equation to a physical picture: a moving source emits crests from different positions, a moving observer meets those crests sooner or later, and the arrival rate determines the observed pitch or frequency.

The most familiar example is a siren. As an ambulance approaches, the sound seems higher because the wavefronts in front of the vehicle are compressed. After it passes, the sound seems lower because the wavefronts behind it are stretched out. The same idea appears in radar, sonar, astronomy, and medical imaging. This tool focuses on the classical Doppler effect in a stationary medium, which makes it useful for sound and other nonrelativistic wave problems where the medium speed is known.

The form asks for five quantities. f₀ is the emitted frequency in hertz. vₛ is the source velocity. v₀ is the observer velocity. v is the wave speed in the medium, such as the speed of sound in air. Δt is the simulation time step used by the animation. Positive velocities point to the right in the visual model, so the sign matters. A positive source velocity means the source moves rightward; a negative value means it moves leftward. The same sign convention applies to the observer.

The calculator uses the standard one-dimensional classical Doppler relation shown below. It is preserved here in MathML so the formula remains machine-readable and accessible:

fobs = f0 v + v0 v - vs

Read the equation from left to right. The observed frequency starts from the emitted frequency and is then scaled by a ratio. If the observer moves toward incoming waves, the numerator becomes larger and the observed frequency rises. If the source moves toward the observer, the denominator becomes smaller and the observed frequency also rises. If either one moves away, the opposite happens. The calculation assumes the medium itself is stationary and uniform, and it assumes the magnitudes of the source and observer speeds stay below the wave speed so the classical formula remains well behaved.

The animation uses the same physical assumptions but computes arrivals by tracking emitted wavefronts over time. Each ripple is centered at the source position at the instant of emission. After that, the ripple expands at speed v regardless of where the source moves next. When a ripple reaches the observer, the script records the arrival time. The observed frequency shown in the results area is based on the spacing between successive arrivals, so the visual model and the analytic formula reinforce each other.

To use the calculator well, think first about direction and units. All speeds are in meters per second, frequency is in hertz, and the time step is in seconds. If you are modeling a car horn in air, a wave speed near 343 m/s is a common starting value at room temperature. If the source is approaching a stationary observer, enter a positive source velocity and leave the observer velocity at zero. If the observer is moving toward a stationary source, enter a positive observer velocity instead. If both are moving away from each other, one or both velocities may be negative depending on the chosen direction.

A short worked example makes the interpretation concrete. Suppose a horn emits 440 Hz, the source moves toward the observer at 30 m/s, the observer is stationary, and the wave speed is 343 m/s. Then the predicted observed frequency is about 482 Hz. In the animation, you will see the rings packed more tightly in front of the source, and the observer will encounter them more often than the source emits them in its own rest pattern. If the source later passes and recedes, the spacing at the observer grows and the heard frequency drops below 440 Hz.

This page also includes a mini-game below the main calculator. The game is not a separate formula; it is another way to build intuition. You try to keep the observed frequency ratio inside a target band while the source speed and medium conditions drift. That makes the relationship between motion and pitch feel less abstract. If you are teaching or learning the topic, the calculator gives the exact setup and the game gives repeated practice with the same ideas.

Keep the limitations in mind. The model is one-dimensional, so it does not include angles between the line of motion and the line of sight. It is classical rather than relativistic, so it is not intended for light at very high speeds. It also assumes a uniform medium without wind gradients or refraction. Within those assumptions, the tool is useful for classroom demonstrations, quick checks, and scenario comparisons.

If you want to sanity-check a result, ask three simple questions. First, does the sign of motion match the physical situation you mean to model? Second, are the speeds smaller than the wave speed? Third, does the result move in the expected direction when you slightly increase or decrease one input? If the answer to all three is yes, the output is usually easy to trust. You can also export the arrival times as CSV if you want a record of the simulation or want to compare runs outside the browser.

Physical interpretation, assumptions, and example scenarios

The Doppler effect is fundamentally about spacing in time and space. A source that emits one crest every fixed interval does not change its own emission schedule just because it starts moving. What changes is where each crest begins. If the source moves toward the observer between emissions, the next crest starts closer to the observer than the previous one did. That shortens the arrival interval and raises the observed frequency. If the source moves away, the next crest starts farther away, lengthening the arrival interval and lowering the observed frequency.

The observer’s motion matters for a complementary reason. Even if the source is fixed, an observer moving into the oncoming wavefronts meets them more quickly. An observer moving away meets them less often. In the formula, source motion changes the denominator because it changes the spacing of emitted wavefronts in the medium, while observer motion changes the numerator because it changes how quickly the observer sweeps through that pattern.

The simulation step size Δt does not change the underlying physics, but it does affect numerical resolution. Smaller values give more precise arrival timing at the cost of more updates. Larger values run more coarsely. The allowed range in the form keeps the animation stable and responsive. For most casual use, the default value is a good compromise.

Here are three common ways to interpret the inputs. In a passing-siren problem, set the source frequency to the siren tone, use the vehicle speed for vₛ, keep v₀ at zero if the listener is standing still, and use the speed of sound for v. In a moving-listener problem, such as a cyclist riding toward a stationary bell, set vₛ to zero and enter the cyclist speed as v₀. In a chase problem, where both source and observer move, use the sign convention carefully so the relative directions are represented correctly.

A second worked example shows how sign choice changes the answer. Suppose the source emits 600 Hz, the source moves left at 20 m/s, the observer moves right at 15 m/s, and the wave speed is 343 m/s. With the page’s sign convention, that means vₛ = -20 and v₀ = 15. The observer is moving toward the source while the source is moving away from the observer’s side of the medium, so the two effects partly compete. The result is still shifted, but not in the same way as a simple head-on approach. Running the animation makes that easier to see than reading the signs alone.

The comparison cards under the form summarize the emitted frequency, the observed frequency, and the ratio between them. A ratio above 1 means the observer hears a higher frequency than the source emits. A ratio below 1 means the observer hears a lower frequency. A ratio of exactly 1 appears when there is no effective Doppler shift, such as when both velocities are zero in the default setup.

Because the page includes both an equation-based interpretation and a wavefront-based simulation, it works well for checking intuition. If you ever get a surprising result, pause and think about whether the observer is moving into the crests or away from them, and whether the source is compressing or stretching the spacing in front of itself. That physical picture usually reveals sign mistakes immediately.

Another useful way to think about the result is to separate what belongs to the medium from what belongs to the moving objects. The wave speed v belongs to the medium. For sound in still air, it is set by the properties of the air, not by the source. The source frequency f₀ belongs to the emitter. The observed frequency depends on both, but for different reasons. The source determines how often crests are launched, while the medium determines how fast those crests travel once they exist. This distinction is why a moving source can change the spacing of wavefronts in the medium without changing its own emission frequency.

Students often ask why the source velocity appears with a minus sign in the denominator while the observer velocity appears with a plus sign in the numerator. The answer is that the two motions affect different parts of the process. Source motion changes the wavelength laid down in the medium. Observer motion changes the rate at which the observer crosses that wavelength pattern. In a one-dimensional sign convention, those effects naturally enter the formula in different places. The animation on this page is especially helpful here because it lets you see the source laying down compressed or stretched rings while the observer moves through them.

If you are using the calculator for teaching, it can help to run a sequence of simple cases. Start with both velocities at zero so the ratio is 1. Then move only the observer and watch the numerator effect. Reset and move only the source to isolate the denominator effect. Finally, move both and compare the combined result with your expectation. That progression turns the formula from a symbol pattern into a set of understandable physical causes.

Formula reference and equivalent forms

Some readers like to compare the main equation with closely related forms. The calculator itself uses the same classical relationship throughout, but it can be written in several equivalent ways depending on whether you want to emphasize observed frequency, wavelength, period, or ratio.

f_obs = f0 (v + v0) / (v - vs)

f_obs / f0 = (v + v0) / (v - vs)

v = f λ, λ_front = (v - vs) / f0, λ_back = (v + vs) / f0

T_obs = 1 / f_obs, T0 = 1 / f0, ratio = f_obs / f0

|vs| < v and |v0| < v keep the classical model well behaved.

These expressions are not separate calculators. They are simply different views of the same model, and the animation still computes the motion numerically from wavefront arrival times.

Reading the result and understanding the limits

When the simulation is running, the main result area updates after at least two wavefront arrivals have been recorded. That is why the observed frequency may briefly remain blank at the start. The script needs a time interval between arrivals before it can estimate a frequency. Once that interval exists, the page reports the observed value in hertz and also shows the ratio relative to the source frequency.

If the observed frequency is higher than the source frequency, the observer is effectively encountering wavefronts more often than they are emitted in the source’s own frame. If it is lower, the observer is encountering them less often. In sound problems, that corresponds to a higher or lower perceived pitch. In other wave contexts, it corresponds to a shift in measured frequency rather than necessarily a change in audible tone.

The CSV export contains the recorded arrival times. That file is useful if you want to verify the periods manually, compare multiple runs, or use the data in a spreadsheet. Because the simulation is discrete in time, very small differences between the analytic formula and the measured arrival-based estimate can appear, especially if you choose a larger time step. Reducing Δt generally improves timing precision.

This calculator is best used as a clear classical model. It does not include relativistic Doppler shift, shock-wave formation, angular projection in two or three dimensions, or changing wave speed due to wind and temperature gradients across space. Those effects matter in advanced applications, but for many educational and practical sound problems, the present assumptions are exactly the right level of detail.

One more practical note: if you enter speeds very close to the wave speed, the ratio can change dramatically. That is not a bug. It reflects the fact that the denominator in the classical formula becomes small when the source speed approaches the wave speed in the medium. The page prevents invalid values where the source or observer speed magnitude equals or exceeds the wave speed, because those cases would break the assumptions used by the script and would no longer fit the simple classical model shown here.

For classroom use, the strongest habit is to pair every numeric answer with a sentence in plain language. Instead of stopping at “482 Hz,” say “the observer hears a higher pitch because the source is moving toward the observer and compressing the wavefronts ahead of it.” That habit makes sign conventions easier to remember and helps catch mistakes before they spread into later calculations.

If you are comparing scenarios, keep one variable fixed at a time. Change only the source speed, then only the observer speed, then only the medium speed. The calculator is fast enough to support that kind of side-by-side reasoning, and the CSV export gives you a simple way to save runs for later review. In that sense, the page is not just a one-off answer tool. It is also a compact experiment platform for classical Doppler problems.

Calculator inputs and live simulation

The form below is the working part of the page. Enter the emitted frequency, source speed, observer speed, wave speed, and simulation time step, then use the controls to play, pause, reset, or download the arrival-time data. The calculator updates the summary cards and the canvas as the simulation runs. If you prefer to think numerically, focus on the observed frequency and ratio. If you prefer to think visually, watch how the spacing of the rings changes in front of and behind the moving source.

Enter values and press Play.

Source frequency

440 Hz

Baseline emitted tone.

Observed frequency

Observed versus source ratio

Simulation summary will appear here.

Doppler Pitch Pursuit

Use the thrust controls or the arrow keys to nudge the observer and keep the observed frequency ratio inside the highlighted window while the source speed and medium conditions drift. The game turns the same Doppler relationship used in the calculator into a quick reflex exercise, so you can feel how small velocity changes alter the heard pitch.

Doppler pitch pursuit mini-game requires a browser that supports canvas.

Click Play to begin the training run.

Observed ratio 1.000×
Target window
Observer speed 0 m/s
Source speed 0 m/s
Medium speed 343 m/s
Time in band 0.0 s
Score 0
Best run 0

Hitting the band when gusts arrive restores a little health.