We will focus on sound waves in describing the Doppler effect, but it works for other waves too.
Consider a stationary source of sound broadcasting a single frequency sound wave. You are the observer of the sound wave, and you are also stationary. The usual relationship between frequency, speed, and wavelength is:
f = v/λ
v represents the speed of sound through the medium.
Let's say you, the observer, now move toward the source with velocity vO. You encounter more waves per unit time than you did before. Relative to you, the waves travel at a higher speed:
v/ = v + vO
The frequency of the waves you detect is higher, and is given by:
f/ = v//λ = (v + vO) /λ
If you moved away from the source the observed frequency is lower. In general the observed frequency when the observer moves is:
f/ = (v +/- vO) /λ = (v +/- vO)* f/v = f * (v +/- vO)/v
Use the first sign (+) when the observer moves toward the source and the second sign (-) when the observer moves away.