The Doppler effect occurs when there is relative motion between the source and the observer (recorder.) When the distance between the source and the observer is decreasing, the frequency is higher (wavelength is shorter). When the distance between the source and observer is increasing, then the observer measured frequency is lower (the wavelength is longer.) Note that the Doppler effect occurs for a stationary observer and the source is moving (ergo racecars moving toward and then away from the stationary observer.)