[sdiy] Digital filtering of pot input

rsdio at audiobanshee.com rsdio at audiobanshee.com
Sat Dec 3 09:20:12 CET 2016

Doesn't this mean that you can't reach the top and bottom of your pot?

For example, if you have an 8-bit ADC ranging from 0 to 255, and H is 2, then your values would only range from 2 to 253. Some of the time, it would only reach 3 to 252, depending upon how fast the user turned the pot and when the ADC scanned the input.

I suppose it doesn't matter if you're scaling the value to create the final parameter, since you could just scale 3..252 as a range of 250 and make it work.


On Dec 2, 2016, at 9:21 AM, Matthias Puech <matthias.puech at gmail.com> wrote:
> All right, got it! Thanks a lot Richie.
> What you describe is:
>  if (in - out > H) 
>    out = in - H
>  else if (in - out < -H) 
>    out = in + H
> It works like a charm, and is super simple. Indeed, I do a bit of boxcar filtering before, and a bit of one pole IIR after, to smoothen the angles.

More information about the Synth-diy mailing list