[Openal-devel] Doppler Velocity and Distance Factor
jmj at atc.creative.com
jmj at atc.creative.com
Mon Mar 7 16:05:45 PST 2005
I would like to propose some corrections to sections 3.3 and 3.5.2, and
suggest that we introduce a distance factor in OpenAL 1.1 (defined like in
DirectSound3D).
Summary of proposal:
===================
AL_DISTANCE_FACTOR defines the distance unit used to express all
distances and velocities (as in DS3D).
AL_DOPPLER_FACTOR is still used to scale velocities in order to
exaggerate or deemphasize the Doppler shift.
AL_DOPPLER_VELOCITY still acts as the reciprocal of
AL_DOPPLER_FACTOR. It could be deprecated but we should maintian it
for backwards compatibility.
The default value of AL_DISTANCE_FACTOR is 1.0, meaning that all
distances and velocities are expressed in meters.
To express distances and velocities in feet, one should set
AL_DISTANCE_FACTOR to 0.305.
I think this is preferable to adding a Speed Of Sound parameter in
OpenAL (defaulting to 343.3), because:
- A Speed Of Sound parameter would be redundant with Doppler Factor (as
seen in the equations below).
- It could not be explicitly used to scale the distance unit for
distance dependent effects.
- It might suggest that OpenAL supports "propagation delays" (applied to
each source signal according to the source-listener distance).
Details and rationale:
=====================
In section 3.3:
--------------
The statement that the application is free to use any unit for distances
is true (except when EAX is used). However, that is not the case for
velocities, since the Doppler shift formula implicitly involves the
knowledge of the distance unit used to express velocities. We could
remedy this inconsistency by explicitly introducing the distance factor
in OpenAL, as proposed below.
In section 3.5.2:
----------------
The statement "The application can increase or decrease that frequency
shift by specifying the scaling factor OpenAL should apply to the result
of the calculation" is no longer correct in view of the revised Doppler
shift formula. I think it should be replaced by "The application can
increase or decrease that frequency shift by specifying the scaling
factor that OpenAL should apply to source and listener velocities."
Similarly, the statement "AL_DOPPLER_FACTOR is a simple scaling..." at
the top of the next page should perhaps be replaced by
"AL_DOPPLER_FACTOR is a simple scaling of source and listener velocities
to exaggerate of deemphasize the ...".
In the Doppler shift equations:
DV = AL_DOPPLER_VELOCITY (default value = 1)
DF = AL_DOPPLER_FACTOR (default value = 1)
vl = listener velocity (scalar, projected on source-to-listener
vector)
vs = source velocity (scalar, projected on listener-to-source vector)
f = frequency of sample
f’ = Doppler shifted frequency
vs = min (vs, (DV * 343.3) / DF)
vl = min (vl, (DV * 343.3) / DF)
f’ = f * (DV - DF * vl) / (DV + DF * vs)
This last formula needs to be corrected as follows:
f’ = f * (DV * 343.3 - DF * vl) / (DV * 343.3 + DF * vs)
Note that setting (DV, DF) = (2, 1) is exactly equivalent to setting
(DV, DF) = (1, 0.5).
In other words, DV is unnecessary because it only acts as the reciprocal
of DF.
Proposal: distance factor
-------------------------
When comparing DS3D and OpenAL, AL_DOPPLER_VELOCITY = 1/(DirectSound3D's
distance factor). However, AL_DOPPLER_VELOCITY affects only the Doppler
Shift, while distance factor can also be used for distance dependent
effects (e. g. air absorption).
I think it would be useful to explicitly introduce the distance factor
in OpenAL as follows:
DistF = AL_DISTANCE_FACTOR (default value = 1)
DopF = AL_DOPPLER_FACTOR (default value = 1)
DopV = AL_DOPPLER_VELOCITY (default value = 1)
vs = min (vs, (DopV * 343.3) / (DopF * DistF) )
vl = min (vl, (DopV * 343.3) / (DopF * DistF) )
f’ = f * (DopV * 343.3 / DistF - DopF * vl) / (DopV * 343.3 / DistF
+ DopF * vs)
I think that making these modifications in sections 3.3 and 3.5.2 would
be a useful clarification for OpenAL, and would address the concerns
expressed in recent posts.
Cheers,
Jean-Marc Jot
Creative Advanced Technology Center
1500 Green Hills road. Scotts Valley, CA 95066.
831 440 2995 jmj at atc.creative.com
More information about the Openal-devel
mailing list