aboutsummaryrefslogtreecommitdiffstats
path: root/alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-12-08 18:17:16 -0800
committerChris Robinson <[email protected]>2021-12-08 18:17:16 -0800
commita8ea3cad227432df2a301a7b897492179591852d (patch)
tree43b9985da9e69370bac577e8fccd7b21dcb0bcac /alc/panning.cpp
parent462a1d3ebd0160c27d3e41f1ed6c5721a0e9b009 (diff)
Adjust the crossover frequency for HRTF ambisonic decoding
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r--alc/panning.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 83b6716d..d686de1d 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -735,6 +735,19 @@ void InitHrtfPanning(ALCdevice *device)
static_assert(al::size(AmbiPoints1O) == al::size(AmbiMatrix1O), "First-Order Ambisonic HRTF mismatch");
static_assert(al::size(AmbiPoints2O) == al::size(AmbiMatrix2O), "Second-Order Ambisonic HRTF mismatch");
+ /* A 700hz crossover frequency provides tighter sound imaging at the sweet
+ * spot with ambisonic decoding, as the distance between the ears is closer
+ * to half this frequency wavelength, which is the optimal point where the
+ * response should change between optimizing phase vs volume. Normally this
+ * tighter imaging is at the cost of a smaller sweet spot, but since the
+ * listener is fixed in the center of the HRTF responses for the decoder,
+ * we don't have to worry about ever being out of the sweet spot.
+ *
+ * A better option here may be to have the head radius as part of the HRTF
+ * data set and calculate the optimal crossover frequency from that.
+ */
+ device->mXOverFreq = 700.0f;
+
/* Don't bother with HOA when using full HRTF rendering. Nothing needs it,
* and it eases the CPU/memory load.
*/