## Doppler Extension

Version 2
*(Nils Peters, 08/19/2011 10:59 pm)*
→
Version 3/6
*(Nils Peters, 08/19/2011 11:00 pm)*

h1. Doppler Extension

h2. Review

h3. Open AL 1.1

The Doppler Effect depends on the velocities of source and listener relative to the medium, and the propagation speed of sound in that medium. One can emphasize or de-emphasize the Doppler Effect because physically accurate calculation might not give the desired results. The amount of frequency shift (pitch change) is proportional to the speed of listener and source along their line of sight.

Effects of the medium (air, water) moving with respect to listener and source are ignored.

@SS: AL_SPEED_OF_SOUND@ = speed of sound (default value 343.3)

@DF: AL_DOPPLER_FACTOR@ = Doppler factor (default 1.0)

@vls:@ Listener velocity scalar (scalar, projected on source-to-listener vector)

@vss:@ Source velocity scalar (scalar, projected on source-to-listener vector)

@f:@ Frequency of sample @f'@: f': effective Doppler shifted frequency

*3D Mathematical representation of vls and vss:*

<pre>

Mag(vector) = sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z)

DotProduct(v1, v2) = (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z)

SL = source to listener vector SV = Source velocity vector

LV = Listener velocity vector

vls = DotProduct(SL, LV) / Mag(SL)

vss = DotProduct(SL, SV) / Mag(SL)

</pre>

*Dopper Calculation:*

<pre>

vss = min(vss, SS/DF)

vls = min(vls, SS/DF)

f' = f * (SS - DF*vls) / (SS - DF*vss)

</pre>

h2. Review

h3. Open AL 1.1

The Doppler Effect depends on the velocities of source and listener relative to the medium, and the propagation speed of sound in that medium. One can emphasize or de-emphasize the Doppler Effect because physically accurate calculation might not give the desired results. The amount of frequency shift (pitch change) is proportional to the speed of listener and source along their line of sight.

Effects of the medium (air, water) moving with respect to listener and source are ignored.

@SS: AL_SPEED_OF_SOUND@ = speed of sound (default value 343.3)

@DF: AL_DOPPLER_FACTOR@ = Doppler factor (default 1.0)

@vls:@ Listener velocity scalar (scalar, projected on source-to-listener vector)

@vss:@ Source velocity scalar (scalar, projected on source-to-listener vector)

@f:@ Frequency of sample @f'@: f': effective Doppler shifted frequency

*3D Mathematical representation of vls and vss:*

<pre>

Mag(vector) = sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z)

DotProduct(v1, v2) = (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z)

SL = source to listener vector SV = Source velocity vector

LV = Listener velocity vector

vls = DotProduct(SL, LV) / Mag(SL)

vss = DotProduct(SL, SV) / Mag(SL)

</pre>

*Dopper Calculation:*

<pre>

vss = min(vss, SS/DF)

vls = min(vls, SS/DF)

f' = f * (SS - DF*vls) / (SS - DF*vss)

</pre>