From b0b1446aa7a9305ccb830a9e4ac47761601c5bac Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 6 Feb 2022 21:53:42 -0800 Subject: [PATCH] HRIR Filter: Corrected scale math, fixing volume The volume should have been twice what it was, because I got this scale wrong. The correct scale for Accelerate inverse FFT is 1/4 per sample, not 1/8 like I accidentally misread while rewriting a convolver for the umpteenth time from scratch. Signed-off-by: Christopher Snowhill --- Audio/Chain/HeadphoneFilter.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Audio/Chain/HeadphoneFilter.m b/Audio/Chain/HeadphoneFilter.m index 5cbb30336..5fd059f2d 100644 --- a/Audio/Chain/HeadphoneFilter.m +++ b/Audio/Chain/HeadphoneFilter.m @@ -424,7 +424,7 @@ static const int8_t speakers_to_hesuvi_14[8][2][8] = { } - (void)process:(const float *)inBuffer sampleCount:(size_t)count toBuffer:(float *)outBuffer { - const float scale = 1.0 / (8.0 * (float)fftSize); + const float scale = 1.0 / (4.0 * (float)fftSize); while(count > 0) { size_t countToDo = (count > bufferSize) ? bufferSize : count;