One-pole high-pass filter:
float last_out = 0,
last_in = x;
for (uint32_t i = 0; i < len; i++) {
out[i] = last_out * 0.995 + in[i] - last_in;
last_out = out[i];
last_in = in[i];
}
100x slowdown when
in
is mostly zeros.
Native solution: FTZ, flush denormals to zero:
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);