#1021 Updates FIR filter to use the java Math.fma floating point multiply and accumulate instruction for more efficient processing. (#1022)

Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
Denny Sheirer
2020-12-27 06:48:37 -05:00
committed by GitHub
parent f0d9ef99ea
commit 2847dff64a

View File

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