[sdiy] Digital filtering of pot input
modular at go2.pl
Fri Dec 2 15:06:27 CET 2016
Can't you just average, say, 16 ADC readings? This will do some
filtering. Then you should be able to lower down the 0.01 change
threshold to maybe 0.001 and get much smaller staircase.
Or add small IIR lowpass filter, there's lots of computing power to use
and at pot scanning sample rate this is almost nothing.
W dniu 2016-12-02 o 13:51, Matthias Puech pisze:
> Hi DIYists,
> 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?
> Thanks in advance,
> Synth-diy mailing list
> Synth-diy at synth-diy.org
More information about the Synth-diy