As a train approaches passes and then recedes the frequency of its whistle appears to change.  This is known as the Doppler effect.