The Doppler Effect explains shifts in the length of various waves. Waves moving toward us are compressed and the wavelength decreases. In contrast, waves moving away have an increased wavelength. The effect on sound waves is to change the pitch while on light the color shifts. Astronomers use the "redshift" to measure the distance to a galaxy and its approximate rate of travel.