
completed some remixing
enjoy!
reference:
http://www.physicsclassroom.com/class/waves/u10l3d.cfmThe Doppler effect is observed whenever the source of waves is moving with respect to an observer. The Doppler effect can be described as the effect produced by a moving source of waves in which there is an apparent upward shift in frequency for observers towards whom the source is approaching and an apparent downward shift in frequency for observers from whom the source is receding. It is important to note that the effect does not result because of an actual change in the frequency of the source. Using the simulation above, the source is still producing disturbances such as sound at a rate of f = 0.5 disturbances per second (select T period as 2 second); it just appears to the observer that the source of the wave is approaching say vsource = 170 m/s that the disturbances are being produced at a frequency greater than 0.5 disturbances/second. using the formula f' = f ( c+vobserver) / (c - vsource) = 0.5* ( 330+0)/(330-170) = 1.03 Hz.
when the source is traveling away from the observer, the formula is now formula f' = f ( c-vobserver) / (c + vsource) = 0.5* ( 330-0)/(330+170) = 0.33 Hz.
The Doppler effect can be observed for any type of wave - water wave, sound wave, light wave, etc. We are most familiar with the Doppler effect because of our experiences with sound waves. Perhaps you recall an instance in which a police car or emergency vehicle was traveling towards you on the highway. As the car approached with its siren blasting, the pitch of the siren sound (a measure of the siren's frequency) was high; and then suddenly after the car passed by, the pitch of the siren sound was low. That was the Doppler effect - an apparent shift in frequency for a sound wave produced by a moving source.

The Doppler effect is of intense interest to astronomers who use the information about the shift in frequency of electromagnetic waves produced by moving stars in our galaxy and beyond in order to derive information about those stars and galaxies. The belief that the universe is expanding is based in part upon observations of electromagnetic waves emitted by stars in distant galaxies. Furthermore, specific information about stars within galaxies can be determined by application of the Doppler effect. Galaxies are clusters of stars that typically rotate about some center of mass point. Electromagnetic radiation emitted by such stars in a distant galaxy would appear to be shifted downward in frequency (a red shift) if the star is rotating in its cluster in a direction that is away from the Earth. On the other hand, there is an upward shift in frequency (a blue shift) of such observed radiation if the star is rotating in a direction that is towards the Earth.
reference
http://www.kettering.edu/physics/drussell/Demos/doppler/doppler.htmlf prime = f ( c + vobserver ) / ( c - vsource) for towards each other (approaching)
f prime = f ( c - vobserver ) / ( c + vsource) for moving away from each other (separating)
codes are:
frequencyemitted = 1/T;
if ((x-xe)*(v0-vobserver) >0){ // towards each other
frequencydetected = frequencyemitted*( v0+ vobserver)/( v0+ vs);
}
else {
frequencydetected = frequencyemitted*( v0- vobserver)/( v0- vs);
}
Or as in Wikipedia,
In classical physics, where the speeds of source and the receiver relative to the medium are lower than the velocity of waves in the medium, the relationship between observed frequency
f and emitted frequency
f0 is given by:
[3]

where
is the velocity of waves in the medium
is the velocity of the receiver relative to the medium; positive if the receiver is moving towards the source.
is the velocity of the source relative to the medium; positive if the source is moving away from the receiver.
Read the top signs to use when approaching and bottom signs when separating
Stationary Sound Source
 |
Stationary Sound Source |
Stationary sound source produces sound waves at a constant frequency f, and the wave-fronts propagate symmetrically away from the source at a constant speed c (assuming speed of sound, c = 330 m/s), which is the speed of sound in the medium. The distance between wave-fronts is the wavelength. All observers will hear the same frequency, which will be equal to the actual frequency of the source where
f = f0.
Source moving with vsource = 0.7*vsound ( Mach 0.7 )
 |
Source moving with vsource = 0.7*vsound ( Mach 0.7 ) |
The same sound source is radiating sound waves at a constant frequency in the same medium. However, now the sound source is moving to the right with a speed vs = 0.7 c (Mach 0.7). The wave-fronts are produced with the same frequency as before. However, since the source is moving, the center of each new wavefront is now slightly displaced to the right. As a result, the wave-fronts begin to bunch up on the right side (in front of) and spread further apart on the left side (behind) of the source. An observer in front of the source will hear a higher frequency

, and an observer behind the source will hear a lower frequency
Source moving with vsource = vsound ( Mach 1 , breaking the sound barrier )
 |
Source moving with vsource = vsound ( Mach 1 , breaking the sound barrier ) |
Now the source is moving at the speed of sound in the medium (vs = c, or Mach 1). assuming the speed of sound in air at sea level is about 330 m/s . The wave fronts in front of the source are now all bunched up at the same point. As a result, an observer in front of the source will detect nothing until the source arrives where

. An observer behind of the source

. The pressure front will be quite intense (a shock wave), due to all the wavefronts adding together, and will not be percieved as a pitch but as a "thump" of sound as the pressure wall passes by. The figure at right shows a bullet travelling at Mach 1.01. You can see the shock wave front just ahead of the bullet.
Jet pilots flying at Mach 1 report that there is a noticeable "wall" or "barrier" which must be penetrated before achieving supersonic speeds. This "wall" is due to the intense pressure front, and flying within this pressure front produces a very turbulent and bouncy ride. Chuck Yeager was the first person to break the sound barrier when he flew faster than the speed of sound in the X-1 rocket-powered aircraft on October 14, 1947. Check out the movie The Right Stuff for more about this significant milestone, and the beginnings of the US space project. The figure at right shows a n F-18 at the exact instant it goes supersonic. Click on the figure to see more information and a MPEG movie of this event.
Source moving with vsource = 1.4*vsound (Mach 1.4 , supersonic)
 |
Source moving with vsource = 1.4*vsound (Mach 1.4 , supersonic) |
The sound source has now broken through the sound speed barrier, and is traveling at 1.4 times the speed of sound, c (Mach 1.4). Since the source is moving faster than the sound waves it creates, it actually leads the advancing wavefront. The sound source will pass by a stationary observer before the observer actually hears the sound it creates. As a result, an observer in front of the source will detect

and an observer behind the source

.
As you watch the animation, notice the clear formation of the Mach cone, the angle of which depends on the ratio of source speed to sound speed. It is this intense pressure front on the Mach cone that causes the shock wave known as a sonic boom as a supersonic aircraft passes overhead. The shock wave advances at the speed of sound v, and since it is built up from all of the combined wave fronts, the sound heard by an observer will be quite intense. A supersonic aircraft usually produces two sonic booms, one from the aircraft's nose and the other from its tail, resulting in a double thump.
The figure at right shows a bullet traveling at Mach 2.45. The mach cone and shock wave-fronts are very noticeable.
Contribution to wikimedia as an active citizen of the world