## Doppler Extension

Version 5 (Nils Peters, 08/19/2011 11:02 pm)

 1 2 3 1 Nils Peters `h1. Doppler Extension` 1 Nils Peters 1 Nils Peters `h2. Review` 1 Nils Peters 1 Nils Peters `h3. Open AL 1.1` 1 Nils Peters 1 Nils Peters `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.` 1 Nils Peters `Effects of the medium (air, water) moving with respect to listener and source are ignored.` 1 Nils Peters 2 Nils Peters `@SS: AL_SPEED_OF_SOUND@ = speed of sound (default value 343.3)` 1 Nils Peters `@DF: AL_DOPPLER_FACTOR@ = Doppler factor (default 1.0) ` 1 Nils Peters 1 Nils Peters `@vls:@ Listener velocity scalar (scalar, projected on source-to-listener vector) ` 1 Nils Peters `@vss:@ Source velocity scalar (scalar, projected on source-to-listener vector) ` 5 Nils Peters `@f:@ Frequency of sample ` 5 Nils Peters `@f'@: effective Doppler shifted frequency` 1 Nils Peters 1 Nils Peters `*3D Mathematical representation of vls and vss:*` 1 Nils Peters 2 Nils Peters `
`
1  Nils  Peters  `Mag(vector) = sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z) `
1  Nils  Peters  `DotProduct(v1, v2) = (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z) `
4  Nils  Peters  `
` 4 Nils Peters `@SL@ = source to listener vector ` 4 Nils Peters `@SV@ = Source velocity vector` 4 Nils Peters `@LV@ = Listener velocity vector` 4 Nils Peters `
`
1  Nils  Peters  `vls = DotProduct(SL, LV) / Mag(SL) `
1  Nils  Peters  `vss = DotProduct(SL, SV) / Mag(SL)`
2  Nils  Peters  `
` 1 Nils Peters 1 Nils Peters `*Dopper Calculation:*` 2 Nils Peters `
`
1  Nils  Peters  `vss = min(vss, SS/DF) `
1  Nils  Peters  `vls = min(vls, SS/DF) `
1  Nils  Peters  `f' = f * (SS - DF*vls) / (SS - DF*vss)`
2  Nils  Peters  `
`