[sdiy] Digital filtering of pot input

rsdio at audiobanshee.com rsdio at audiobanshee.com
Sat Dec 3 08:49:47 CET 2016

I assume that you meant to type:

if (fabs(reading - output) > 0.01)
   output = reading;

On Dec 2, 2016, at 4:51 AM, Matthias Puech <matthias.puech at gmail.com> wrote:
> I have a potentially simple question on filtering. I get my pot reading from a very noisy ADC (on-board STM32F4), but I absolutely need the value to be constant when I'm not touching the pot. It's ok for it to be a bit wobbly while I am turning the pot. Now I'm using hysteresis:
> if (fabs(reading - output) < 0.01)
>  output = reading;
> which gives me a stable value when I'm not turning the pot, but I am annoyed by the staircase effect while I'm turning it. Is there a simple filter that will let signal through when there is consistent movement but hold it when not?

More information about the Synth-diy mailing list