The cosmological redshift and blueshift was discovered by Edwin Hubble about a century ago.  But the stretching or compressing of wavelengths because of the relative motion of two objects was studied by Christian Doppler in the 1840s.