[sdiy] A/D converter with good accuracy for a reasonable price?
Scott Gravenhorst
music.maker at gte.net
Fri May 6 01:43:57 CEST 2011
jon schatz <jon at divisionbyzero.com> wrote:
>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.
Yeah, I was thinking that too after I hit send. The filter is a single pole lowpass
IIR filter and is analogous to a simple RC lowpass filter. The higher the value of n,
the lower the "bandwidth" of the filter, that is more suppression of noise at higher
frequencies. So it really depends on what you need from the sample stream. I think
that for reading the value off of pots, the exponential filter method can be nicely
advantageous, and as Jon points out, there is a loss of slew rate, but for pots, how
fast can you turn them anyway?
-- ScottG
________________________________________________________________________
-- Scott Gravenhorst
-- FPGA MIDI Synthesizer Information: home1.gte.net/res0658s/FPGA_synth/
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Synth-diy
mailing list