From 738714800621cc7d8f74321883c301a14e3a04c3 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 24 Apr 2021 03:12:05 -0700 Subject: [PATCH] Use the root mean square for the HRTF B-Format HF scale For the second-order decoder. Since the delays are adjusted to avoid most high frequency phase cancelation, the energy-based scaling with the number of channels used creates a significant HF increase. Using the RMS-based scaling seems to create a more level response, though it's not perfect either. More testing and measurements may be needed. --- alc/panning.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alc/panning.cpp b/alc/panning.cpp index 4307a8d1..d385ecf0 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -740,7 +740,9 @@ void InitHrtfPanning(ALCdevice *device) static const float AmbiOrderHFGain1O[MaxAmbiOrder+1]{ 2.000000000e+00f, 1.154700538e+00f }, AmbiOrderHFGain2O[MaxAmbiOrder+1]{ - 2.357022604e+00f, 1.825741858e+00f, 9.428090416e-01f + /*AMP 1.000000000e+00f, 7.745966692e-01f, 4.000000000e-01f*/ + /*RMS*/ 9.128709292e-01f, 7.071067812e-01f, 3.651483717e-01f + /*ENRGY 2.357022604e+00f, 1.825741858e+00f, 9.428090416e-01f*/ }; static_assert(al::size(AmbiPoints1O) == al::size(AmbiMatrix1O), "First-Order Ambisonic HRTF mismatch");