Adjust the source, observer, and wave speeds, then play the animation to watch how frequency shifts appear in motion.
Source frequency
440 Hz
Baseline emitted tone.
Observed frequency
—
Observed versus source ratio
—
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)/( v − vs ).
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.
The model treats waves propagating in a uniform medium at speed . The source emits at frequency and moves with velocity along the horizontal axis. The observer travels with velocity . Positive velocities point to the right, so a positive 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 and less than ; otherwise the classic Doppler formula would diverge.
For rectilinear motion in a stationary medium the observed frequency is
derived from the relative spacing of wavefronts. If the observer approaches the source () the numerator increases, raising the frequency. If the source approaches the observer () 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.
The canvas evolves in discrete time steps of size . 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 . Each wavefront stores its center point and emission time. Its radius expands as . 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 , and the observed frequency is . Because the update is explicit and the speed of waves is constant, the algorithm is unconditionally stable. Nevertheless, large 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.
Suppose a car horn emits a steady 440 Hz tone while driving toward a stationary observer at 30 m/s in air where m/s. Enter , , , and . 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: . 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.
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.
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.
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.
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 or to compare Doppler shift with related phenomena like beats.
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.