In 1842, Christian Doppler proposed the Doppler Effect (Shift) in Prague. This effect applies to sound, light and all types of wave. If a train moving towards you, its whistle sound much higher than normal and when it moves away it's pitch is sounded lower.
The frequency of an object(eg. star) moving towards an observer is compressed. Its wavelength is shortened, frequency increased, therefore it is blueshifted. When the object(eg. star) is moving away from the observer, the frequency decreased, wavelength increased, therefore it is said to be redshifted. (Credit:archive.ncsa.illinois.edu)