Doppler effect describes the frequency of a moving source past an observer, for example a siren on an emergency vehicle speeding past a stationary observer.

"Doppler effect from ambulance siren binaurally"#

Ambulance Doppler Effect recorded using binaural microphones

(recorded in the meadows, edinburgh 17/06/2010)

From measuring the change in the ambulances pitch, you could effectively calculate the velocity that it is traveling. This is how speed guns work and how we are able to calculate the relative speed of distant astronomical objects using the Doppler effect.

The effect on the frequency that the observer hears, is one that begins high and gradually decreases before becoming the frequency that it produces at rest, directly in front of the observer. This is due to the sound being compressed by the vehicles motion, relative to the observer.

When the vehicle has passed and is moving away from the observer, the frequency decreases again, as the sound waves produced on the vehicle are being stretched by the vehicles motion, relate to the observer.

The same effect also happens for light relative to a stationary observer, positioned at (p4) in the diagram below (showing how light is shifted for a traveling observer). The below diagram shows that, for a stationary observer at position (p4) with sound travelling from left to right, the waves are compressed as they approach the observer and as they pass and travel away from the observer, they are expanded. Also, notice how the expansion and compression will be different for a source that passes in front, behind or at angles to the observer.

(image from http://archive.ncsa.illinois.edu/Cyberia/Bima/doppler.html,

*Eleni Adrian, NCSA.)*#### Copyright © 1995: Board of Trustees, University of Illinois

The change in frequency depends not only on the speed of the vehicle, the speed of sound and the sources rest frequency, but also on the angle between the source and the observer.

"The phenomenon is due to the fact that during approach of source and observer the apparent pitch of the source of sound is higher than its true pitch and during separation lower than its true pitch"(wood, 1940)

- u0 = observer velocity
- f0 = observer frequency

- fs = source frequency
- us = source velocity
- v = speed of sound (~343m/s)

Above is the equation for the Doppler effect, when considering a source that is not along the wave vector (a connecting straight line between source, observer and beyond), we need an equation that expresses the observer and source at angles to one another.

(picture above shows both the source, observer and the angles that are important for our equations. Picture from Ma, Lianxi et al, Doppler Effect of Mechanical Waves and Light, 2009)

For this we need:

When the source is traveling parallel to the wave vector in front of the observer (or behind) and the observer is stationary, this part of the equation (located at the top right),

is equal to zero.

The equation then becomes:

Which will then be used to calculate the frequency at the observer, having the source velocity, angle from the wave vector to the line joining the source, the frequency of the source and the speed of sound traveling in air.

To help visualize how the frequency changes as the source moves past the observer, a graph of observer frequency over source frequency against angle had to be plotted. The trend shows a slow decrease in frequency until reaching 40 degrees where the change in frequency becomes one that is linear. After passing the position of the observer at 90 degrees, the frequency begins to drop below its rest value and decreases linearly with change in angle until around 140 degrees.

As the speed of the source is increased, the ratio of change increases too.

(mathematics referenced from

doppler effect of mechanical waves and light found in my reference links)

Using this information the Doppler effect can be very easily simulated in Csound.

Csound code for Doppler Effect:

; Lewis Doppler effect

;Dopplereffectangle.orc

sr = 44100

kr = 11025

ksmps = 4

nchnls = 2

instr 2

;p4 = the speed of the source

;p5 = the frequency of the source at rest

idur = p3

k1 linseg 0.174532,idur,2.967 ;change of angle in radians

; radians = (pi/180)*degrees

ang = 1/(1-((p4*cos(k1))/343)) ;proportion of frequency compression and expansion

angle = ang*p5 ;proportion multiplied by frequency

k2 linseg 0,idur/2,10000,idur/2,0 ;Amplitude modulation

krat linseg 0,idur,1 ;Stereo

a2 oscil k2,angle,1

outs a2*krat,a2*(1-krat)

endin

; Lewis Doppler effect

;Dopplereffectangle.sco

f1 0 4096 10 1 ; use gen 10 to compute a sine wave

;instr strt dur Vs Freq(source)

i2 0 5 10 100

i2 7 5 20 500

i2 14 5 5 1000

i2 21 3 20 250

i2 27 5 25 4000

This example can be played in the link:

# "Doppler effect in Csound using trigonometric frequency change"

Doppler Effect synthesized in Csound using trigonometric frequency relationship