This implies that the frequency of the sound waves changes depending on the velocity of the source with respect to you, as the train approaches the pitch is higher indicating a higher frequency and smaller wavelength, as the train recedes from you the pitch is lower corresponding to a smaller frequency and a correspondingly larger wavelength. This fact, called the Doppler effect, is common to all waves, including light waves.