#1021 Corrects previous implementation of dot-product filtering using Math.fma() (#1025)

Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
Denny Sheirer
2020-12-29 03:50:24 -05:00
committed by GitHub
parent 2847dff64a
commit 75ef3217ac

View File

@@ -85,8 +85,7 @@ public class RealFIRFilter2 extends FIRFilter
//Use vector dot product to leverage SIMD intrinsics
for(int x = 0; x < mCoefficients.length; x++)
{
//Note: Math.fma() is 2.5x faster than explicit multiply then accumulate
Math.fma(mData[x], mCoefficients[x], mAccumulator);
mAccumulator = Math.fma(mData[x], mCoefficients[x], mAccumulator);
}
/* Apply gain and return the filtered value */