AnalogFilter.ProcessSample() high CPU with value zero

Post Reply
User avatar
Captain
Posts: 103
Joined: Sat Aug 25, 2018 11:12 am

AnalogFilter.ProcessSample() high CPU with value zero

Post by Captain »

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?
Post Reply

Return to “Module Designer”