Cause of the doppler effect