Pages

Saturday, July 18, 2020

Vroom!

This morning for breakfast, we got some pastries from a favorite bakery. On the way home, another car honked its horn as it passed, and the changing pitch reminded be of something I've often wanted to try: I wondered whether I could simulate the sound of a vehicle moving by an observer, by calculating the Doppler shift at each point.

The Doppler shifted frequency is given by
where v is the velocity of the vehicle, c the speed of sound, and f0 the original frequency. The dot product with r means we only take the part of the velocity that is along the line-of-sight between the vehicle and the observer. That dot product is what leads to the changing pitch: As the vehicle approaches the observer, the angle decreases, lowering the pitch.

I decided to put together another HTML5 doodad to play around with (make sure you have your sound on):

Canvas not supported; please update your browser.

True Frequency


Velocity (mph)


No comments:

Post a Comment