From 751351fd20443d855f4d7d50754ec0d1001f6a97 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 22 Apr 2017 09:49:46 +0100 Subject: [PATCH] DPL2Decoder: Simplify cut-off frequency logic in DesignFIR --- Source/Core/AudioCommon/DPL2Decoder.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp index a6b301fc5a..6c8be523bf 100644 --- a/Source/Core/AudioCommon/DPL2Decoder.cpp +++ b/Source/Core/AudioCommon/DPL2Decoder.cpp @@ -134,16 +134,13 @@ static float* DesignFIR(unsigned int n, float fc, float opt) if (n == 0) return nullptr; - fc = MathUtil::Clamp(fc, 0.001f, 1.0f); - float* w = (float*)calloc(sizeof(float), n); // Get window coefficients Hamming(n, w); - fc1 = fc; // Cutoff frequency must be < 0.5 where 0.5 <=> Fs/2 - fc1 = ((fc1 <= 1.0) && (fc1 > 0.0)) ? fc1 / 2 : 0.25f; + fc1 = MathUtil::Clamp(fc, 0.001f, 1.0f) / 2; k1 *= fc1; // Low pass filter