[sdiy] A/D converter with good accuracy for a reasonable price?

jon schatz jon at divisionbyzero.com
Fri May 6 00:30:20 CEST 2011


On 5/5/2011 3:02 PM, Scott Gravenhorst wrote:

> If you are averaging (for example) four ADC readings, you collect them,
> add them together and divide by four (or right shift by 2 bits).

you can also do some exponential filtering:

newResult = ( prevResult * (n-1) + curAdcReading) / n;

which has the advantage of giving you a new result every cycle instead 
of every n cycles (which the above averaging would do). it also means 
that you'll never get a change greater than 1/n * resolution which can 
be a good thing for reducing noise but a bad thing if you want to track 
sharp changes.

-jon



More information about the Synth-diy mailing list