This is a demonstration of a phenomenon called the Doppler effect. It results from the motion of a source coming towards, and going away from an observer. This effect can occur with both sound and light, because both sound and light reveal wave- like behavior. The number of waves reaching an observer in one second is called the frequency. For a given speed, frequency depends upon the length of the wave.
Long waves have a lower frequency than short waves.
As long as the distance between the source of the waves and the observer remains constant, the frequency remains constant. However, if the distance between the observer and the source is increasing, the frequency will decrease. If the distance is decreasing, the frequency will increase. The images below illustrate this effect. Now imagine an everyday-life example such as observing and listening to an approaching car.