When a light source moves with respect to an observer, the signal gets compressed in the direction of the motion and stretched in the opposite direction. This phenomenon is called the Doppler shift. If we know what the frequency of the emitted light is, we can tell how fast the object is moving.
Please check out this video illustrating the Doppler shift:
© Kathryn Hadley PhD 2020