Doppler Effect Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

Adjust the source, observer, and wave speeds, then play the animation to watch how frequency shifts appear in motion.

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.

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 f0 and moves with velocity vs along the horizontal axis. The observer travels with velocity v0. Positive velocities point to the right, so a positive vs 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 |vs| and |v0| less than v; otherwise the classic Doppler formula would diverge.

3. Governing equations

For rectilinear motion in a stationary medium the observed frequency is

fobs=f0v+v0v-vs

derived from the relative spacing of wavefronts. If the observer approaches the source (v0 > 0) the numerator increases, raising the frequency. If the source approaches the observer (vs > 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 1f0. Each wavefront stores its center point and emission time. Its radius expands as r=v(t-te). 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=tn-tn-1, and the observed frequency is 1P. 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 f0=440, vs=30, v0=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: fobs=440343+0343-30482. 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.

Embed this calculator

Copy and paste the HTML below to add the Doppler Effect Simulator with Moving Source and Observer to your website.