Doppler Effect Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

The Doppler effect describes how the observed frequency of a wave changes when there is relative motion between the source and the observer. This Doppler effect calculator and simulator lets you adjust the source speed, observer speed, and wave speed, then watch wavefronts move in time to see how the pitch (frequency) shifts.

This tool is aimed at physics students, instructors, and anyone curious about sound and waves. By combining a numerical calculator with an animation and CSV data export, it helps connect the abstract formula for the Doppler effect to concrete, visual behavior.

Inputs and parameters

The controls above correspond to standard symbols used in Doppler effect formulas for sound in a medium:

  • f₀ (Hz) – the original frequency emitted by the source, measured in hertz (cycles per second). For example, 440 Hz is the musical note A4 commonly used as a tuning reference.
  • vₛ (m/s) – the speed of the source relative to the medium, in meters per second. Positive values usually represent motion toward the right in one-dimensional diagrams.
  • v₀ (m/s) – the speed of the observer relative to the medium, in meters per second. A positive value can be interpreted as motion toward the right.
  • v (m/s) – the speed of the wave in the medium. For sound in air at room temperature, a typical value is about 343 m/s.
  • Δt (s) – the simulation time step in seconds. Smaller values make the animation smoother and more precise, while larger values run faster but look more "stepped" in time.

Use realistic ranges for the speeds. Human-scale motions are usually in the range of a few to a few tens of meters per second, while the sound speed in air is a few hundred meters per second.

Doppler effect formulas

When both the source and observer can move through a medium with wave speed v, a common non-relativistic Doppler effect formula for the observed frequency is:

f_obs = f_0 × v+v_0 v-v_s

In more conventional notation, this is often written as:

f_obs = f₀ × (v + v₀) / (v − vₛ)

where:

  • f₀ – emitted (source) frequency.
  • f_obs – frequency measured by the observer.
  • v – wave speed in the medium.
  • v₀ – observer speed (taken as positive when moving toward the source).
  • vₛ – source speed (taken as positive when moving toward the observer).

The simulator uses this relationship (or an equivalent sign-convention form) at each time step to update the observed frequency as the source and observer move.

How to interpret the simulation

When you press Play, the calculator emits wavefronts from the moving source at intervals based on f₀. The observer encounters these wavefronts at a rate that depends on both its own motion and the motion of the source.

  • If the source and observer move toward each other, the spacing between wavefronts at the observer shrinks, and the observed frequency increases (higher pitch).
  • If they move apart, the spacing between wavefronts at the observer grows, and the observed frequency decreases (lower pitch).
  • If both are at rest relative to the medium, the observer measures a frequency equal to f₀.

The CSV download typically includes time-stamped data describing the positions of the source and observer and the corresponding observed frequency. You can open it in a spreadsheet or plotting tool to graph how the frequency changes with time or position.

Worked example

Consider a simple scenario with sound in air at room temperature. Set the inputs to:

  • f₀ = 440 Hz
  • vₛ = 20 m/s (source moving toward the observer)
  • v₀ = 0 m/s (observer stationary)
  • v = 343 m/s
  • Δt = 0.01 s

Using the Doppler formula:

f_obs = 440 × (343 + 0) / (343 − 20)

The denominator is 323, so:

f_obs ≈ 440 × 343 / 323 ≈ 440 × 1.062 ≈ 468 Hz

In the simulation, the wavefronts in front of the moving source bunch together. At the observer’s location, wavefronts arrive more frequently than they were emitted, corresponding to an observed pitch of about 468 Hz, slightly higher than the original 440 Hz.

If you change the sign of vₛ so the source moves away from the observer (vₛ = −20 m/s), the formula becomes:

f_obs = 440 × (343 + 0) / (343 − (−20)) = 440 × 343 / 363 ≈ 416 Hz

Now the observer hears a lower pitch, and the animation shows wavefronts spreading out behind the retreating source.

Typical scenarios compared

The table below summarizes how different combinations of source and observer motion affect the observed frequency, assuming modest speeds compared to the wave speed.

Scenario Settings (qualitative) Observed frequency vs f₀ What you should see
Stationary source and observer vₛ = 0, v₀ = 0 f_obs = f₀ Evenly spaced wavefronts, no change in pitch over time.
Source approaching observer vₛ > 0 toward observer, v₀ = 0 f_obs > f₀ Wavefronts compressed in front of the source, higher pitch for the observer.
Observer approaching source vₛ = 0, v₀ > 0 toward source f_obs > f₀ Observer passes through wavefronts more often, similar pitch increase to a moving source case.
Source and observer separating vₛ and v₀ moving away from each other f_obs < f₀ Wavefront spacing at the observer increases, pitch gradually drops.
Source and observer moving together in same direction Both moving right, similar speeds f_obs can be slightly higher or lower, depending on relative speed Wavefront pattern drifts with them; only relative speed along the line between them matters.

Example input values to try

  • Moving source, stationary observer – f₀ = 440 Hz, vₛ = 20 m/s, v₀ = 0, v = 343. Watch the pitch rise as the source approaches and drop as it recedes.
  • Moving observer, stationary source – f₀ = 440 Hz, vₛ = 0, v₀ = 20 m/s, v = 343. The observer runs into more wavefronts per second while moving toward the source.
  • Source and observer moving apart – f₀ = 440 Hz, vₛ = 15 m/s, v₀ = −10 m/s, v = 343. The observed frequency falls below 440 Hz as the distance between them grows.

Assumptions and limitations

To keep the Doppler effect calculator simple and fast, several physical assumptions are built into the model:

  • One-dimensional motion – The source and observer move along a single line. Angled motion in two or three dimensions is not explicitly modeled; only the component of velocity along the line between them matters.
  • Constant velocities – The speeds vₛ and v₀ are treated as constant during each run. Accelerations and changing directions are not included.
  • Non-relativistic speeds – All speeds are assumed to be much smaller than the wave speed (and much smaller than the speed of light). Relativistic Doppler effects are not modeled.
  • Uniform medium – The wave speed v is taken as constant. Effects of wind, temperature gradients, or varying material properties are ignored.
  • No extra wave phenomena – Reflections, absorption, interference from multiple sources, and shock waves are not included. The simulation focuses on a single, idealized source and observer.

Because of these simplifications, the calculator is excellent for introductory physics, acoustics demonstrations, and conceptual exploration, but it should not be used for precise engineering design or for high-speed scenarios where relativistic corrections become important.

1. Real‑world phenomenon

The Doppler effect shapes the sound of a passing siren, the color of distant galaxies, and the precision of weather radar. When source and observer move relative to the medium that carries waves, the spacing of successive wave crests changes. Ahead of the motion, crests bunch together and the perceived frequency rises; behind the motion, crests spread apart and pitch drops. This simulator keeps the familiar goal of computing the observed frequency but augments it with a canvas that shows each wavefront racing through space. As you alter source speed, observer speed, or wave speed, new circular ripples radiate outward and sweep across the observer icon. Every impact updates striped bars that compare the emitted and received frequencies, while a caption narrates the event for screen‑reader users. The animation transforms a single equation into a visceral demonstration of relative motion.

2. Variables and assumptions

The model treats waves propagating in a uniform medium at speed v . The source emits at frequency f 0 and moves with velocity v s along the horizontal axis. The observer travels with velocity v 0 . Positive velocities point to the right, so a positive v s indicates the source chasing the observer. At each emission time the wavefront remains centered on the source’s position at that moment; subsequent motion of the source does not drag previously emitted ripples. We assume linear acoustics: waves do not interact, and their speed is independent of amplitude. All inputs use SI units—meters, seconds, and hertz. The interface validates entries to ensure finite numbers and to maintain | v s | and | v 0 | less than v ; otherwise the classic Doppler formula would diverge.

3. Governing equations

For rectilinear motion in a stationary medium the observed frequency is

f obs = f 0 v + v 0 v - v s

derived from the relative spacing of wavefronts. If the observer approaches the source ( v 0 > 0) the numerator increases, raising the frequency. If the source approaches the observer ( v s > 0) the denominator decreases, also raising the frequency. In the special case where both move away from each other the fraction drops below one, yielding a lower pitch. The simulation uses this equation only for validation and comparison; the visual model deduces the received frequency directly from time intervals between wavefront arrivals.

4. Numerical scheme

The canvas evolves in discrete time steps of size Δt . At each step the source and observer positions advance according to their velocities. A new wavefront is emitted whenever simulated time exceeds the last emission by 1 f 0 . Each wavefront stores its center point and emission time. Its radius expands as r = v ( t - t e ) . When the distance between the observer and a wavefront’s center becomes smaller than the radius, a “hit” occurs. The simulator logs the arrival time to compute the instantaneous period P = t n - t n-1 , and the observed frequency is 1 P . Because the update is explicit and the speed of waves is constant, the algorithm is unconditionally stable. Nevertheless, large Δt would blur the arrival timing, so the input is clamped between 0.0005 and 0.05 s. The code debounces form changes to avoid excessive recomputation.

5. Worked example

Suppose a car horn emits a steady 440 Hz tone while driving toward a stationary observer at 30 m/s in air where v =343 m/s. Enter f 0 =440, v s =30, v 0 =0, and v =343. Pressing Play shows ripples emanating from the orange source circle that speeds rightward. As each wavefront strikes the blue observer, the result text reports an observed frequency near 482 Hz, matching the analytic prediction: f obs =440 343+0 343-30 482 . After the source passes the observer and moves away, the hits grow further apart and the frequency drops to about 404 Hz. The CSV export captures arrival times like 0.89, 1.97, 3.14 s, letting you verify the periods with external tools.

6. Comparison table

The table contrasts the baseline car-horn scenario with two variants.

Scenario vₛ (m/s) v₀ (m/s) Analytic f' (Hz)
Baseline 30 0 482
Observer approaching 0 20 465
Both receding -25 -15 394

The simulator reproduces each value within a fraction of a hertz. You can enter the parameters to confirm the wavefront spacing and observe how the striped bars shrink or grow relative to the source frequency.

7. How to read the animation

The canvas shows a horizontal track with an orange circle for the source and a blue circle for the observer. Concentric white rings represent sound waves expanding at constant speed. When the source or observer moves rightward, they approach one another and the rings crowd on the right side. Keyboard users can focus the canvas and press the space bar to toggle play and pause. The caption beneath the canvas announces current time and the latest observed frequency, while the hidden text fallback mirrors this information for assistive technologies. The striped frequency bars use texture in addition to color, ensuring that viewers with color vision deficiencies perceive the difference.

8. Limitations

The simulation assumes a one‑dimensional geometry with the source and observer aligned. Real situations often involve angles or three‑dimensional motion, which require projecting velocities along the line of sight. The medium is treated as static and homogeneous; wind or temperature gradients can alter wave speed and bend paths. Relativistic effects are ignored, so the model breaks down for light or for speeds approaching that of the wave. Numerically, extremely large step sizes reduce timing accuracy, and very long simulations may accumulate floating‑point error in the recorded arrival times.

9. Suggested extensions

Future versions could let users drag the source and observer to arbitrary positions, enabling exploration of oblique approaches. Incorporating relativistic Doppler formulas would broaden the tool to astronomical redshifts. A frequency‑spectrum panel could show how broadband signals stretch or compress. Because the script is self‑contained, educators may modify it to illustrate shock waves as speeds approach v or to compare Doppler shift with related phenomena like beats.

10. References and related tools

For deeper study, consult F. S. Crawford’s Waves volume of the Berkeley Physics Course or the Acoustical Society of America Handbook. Astronomical redshift discussions appear in E. Harrison’s Cosmology. Related calculators on this site include the Doppler Broadening Calculator, the Relativistic Doppler Shift Calculator, and the Wavelength–Frequency Converter.

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

Tap thrust controls or press the arrow keys to nudge the observer and keep the observed frequency ratio inside the highlighted window while gusts push the source speed and the medium drifts. Each clean second in band boosts your score and reinforces how fobs = f0(v + vo)/( vvs ).

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.

Embed this calculator

Copy and paste the HTML below to add the Doppler Effect Calculator & Simulator (Moving Source and Observer) to your website.