A quantitative treatment of the Doppler effect

 (1) fobs = fs × vw ± vobs
vw ± vs
moving source - moving observer
 (2) fobs = fs × vw – vobs
vw

Stationary source
(vs = 0)
Observer moving away from source
(same as direction of the wave)
(3) fobs = fs × vw + vobs
vw
Stationary source
(vs = 0)
observer moving toward source
(opposite to direction of wave)
(4) fobs = fs × vw
vw + vs
Stationary observer 
(vobs = 0)
Source moving away from observer
(opposite to direction of wave)
(5) fobs = fs × vw
vw – vs
Stationary observer
(vobs = 0)
Source moving toward observer
(same as direction of wave)
The frequency at the source and the frequency at the observer are related by the general relationship shown which can be be applied when one of the source or observer is stationery as well as when both are moving.

Note in (1) that 
the velocity of the observer is in the numerator because the frequency at the observer is being calculated.

the equation is simplified if either the source or the observer is stationary because either vs or vobs is zero.
 
Consider the variants of (1) that apply to the various cases where either the source or observer are stationary.
In some cases the velocity of the observer or source is added to that of the wave, and in other cases it is subtracted.

To understand why this is so, it is necessary to recognise 
 
firstly that the wave ALWAYS moves toward the observer.
secondly, that If either the source or the observer

moves in the opposite direction to the wave, the velocities are added (as in (3) and (4))
moves in the same direction as the wave, the velocities are subtracted  (as in (2) and (5))
 
In order to recognize which of these to use in a particular situation, it is good to keep in mind that

a higher frequency at the observer is calculated if numerator of the fraction is larger than the denominator
(as in (3) and (5) where in both cases the source and the observer are moving closer together).

a lower frequency at the observer is calculated if the numerator of the fraction is smaller than the denominator
(as in (2) and (4) where in both cases the source and the observer are moving farther apart).