Velocity Dependent Doppler Effect

The Doppler Effect depends on the velocities of Source and Listener relative to the medium, and the propagation speed of sound in that medium. The application might want to emphasize or de-emphasize the Doppler Effect as 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. The application can increase or decrease that frequency shift by specifying the scaling factor AL should apply to the result of the calculation.

The Doppler Effect as implemented by AL is described by the formula below. Effects of the medium (air, water) moving with respect to listener and source are ignored. DOPPLER_VELOCITY is the propagation speed relative to which the Source velocities are interpreted.

        VD:  DOPPLER_VELOCITY
        DF:  DOPPLER_FACTOR
        vl:  Listener velocity (scalar, projected on source-listener vector)
        vs:  Source velocity (scalar, projected on source-listener vector)
        f:   Frequency of sample
        f':  effective Doppler shifted frequency

        f' = DF * f * (VD-vl)/(VD+vs)

        vl<0, vs>0 :  source and listener approaching each other
        vl>0, vs<0 :  source and listener moving away from each other
      

The implementation has to clamp the projected Listener velocity vl, if abs(vl) is greater or equal to VD. It similarly has to clamp the projected Source velocity vs if abs(vs) is greater or equal to VD.

There are two API calls global to the current context that provide control of the two related parameters. DOPPLER_FACTOR is a simple scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.

void DopplerFactor ( float dopplerFactor );

A negative value will result in an INVALID_VALUE error, the command is then ignored. The default value is 1. The current setting can be queried using GetFloatv and DOPPLER_FACTOR. The implementation is free to optimize the case of DOPPLER_FACTOR being set to zero, as this effectively disables the effect.

NoteAnnotation (No Enable)
 

There is currently no mechanism to switch on/off Doppler calculation using e.g. a DOPPLER_SHIFT token and Enable/Disable. For the time being, DopplerFactor(0) may be used to signal to the implementation that no Doppler Effect calculation is required.

DOPPLER_VELOCITY allows the application to change the reference (propagation) velocity used in the Doppler Effect calculation. This permits the application to use a velocity scale appropriate to its purposes.

void DopplerVelocity ( float dopplerVelocity);

A negative or zero value will result in an INVALID_VALUE error, and the command is ignored. The default value is 1. The current setting can be queried using GetFloatv and DOPPLER_VELOCITY.

NoteAnnotation (No Sideeffects on Delay)
 

To permit independent control of Doppler Effect as opposed to other, sound wave propagation related effects (delays, echos, reverberation), DOPPLER_VELOCITY is not taken into account for any other calculation than Doppler Shift.

NoteAnnotation (SetUnitsPerMeter)
 

DOPPLER_VELOCITY accomplishes the purposes of DS3D scaling parameters in a straightforward way, without introducing the undesirable connotations of real world units.