Why does the doppler effect occur in all waves?