Refactor the doppler shift calculations