A siren sounds higher coming toward you and lower moving away for one reason
The Doppler effect is the change in a wave's apparent frequency caused by motion between its source and an observer: sound waves bunch up and rise in pitch as a source approaches, then stretch out and drop as it recedes. Christian Doppler proposed the principle in 1842, and it was confirmed for sound three years later using trumpeters playing a fixed note on a moving train. Applied to light, the same effect now lets astronomers measure how fast galaxies are moving away from us.
— Christian Doppler, Über das farbige Licht der Doppelsterne — 1842