AnalogFilter.ProcessSample() high CPU with value zero
Posted: Sun Mar 03, 2019 9:26 pm
This might have something to do with how filters work, but out of interest: I noticed that when you call the AnalogFilter.ProcessSample() function with a value of zero, completing the call takes about 6-7 times longer than with non-zero values (at least on my Mac). Any other sample value, no matter how close it is to zero (as long as it's not exactly zero) suddenly makes the function work much faster.
Since there are many cases where a module might feed digital zero through the filter, is there any way to avoid this sudden (and probably unnecessary) CPU hit? Of course I could just skip the filter whenever the input signal settles to zero, or add some slight offset/noise to the input, but these feel like unnecessary kludges.... Any ideas?
Since there are many cases where a module might feed digital zero through the filter, is there any way to avoid this sudden (and probably unnecessary) CPU hit? Of course I could just skip the filter whenever the input signal settles to zero, or add some slight offset/noise to the input, but these feel like unnecessary kludges.... Any ideas?