If we ask a trumpeter in our car to play a middle C, we can tell if the car is
moving to or away from us and how fast it's going by measuring the frequency.
If the car is approaching, the note will sound higher than a C. How much higher
tells us how fast the car's moving. If it's moving away, the note will sound
lower than a C. Again, how much lower tells us how fast.
Light, too, is a wave, and so is influenced by the Doppler effect. However,
instead of pitch we perceive differences in light's frequency as color. The
higher the frequency of light, the closer its color is to the blue end of the
spectrum. Cars' headlights don't appear blue on approach because they move too
slowly to "catch up" enough with the light they produce. However, not
everything moves as slowly as a car. Also, we have instruments far more
sensitive than our eyes.
A key element in determining our trumpeter's speed was knowing that, if the
car wasn't moving, we would have heard a middle C. Astronomers, unfortunately,
don't have the luxury of asking stellar objects to pull over. What if instead
of a single note our trumpeter was playing a familiar tune? Looking at the
notes in the context of the song's pattern makes placing them quite simple. It
turns out that the heavens are full of familiar tunes.