# Digital Filters for ADC output

Discussion in 'Embedded Systems and Microcontrollers' started by priyersi, Mar 7, 2013.

1. ### priyersi Thread Starter New Member

Feb 25, 2013
8
0
Hi all,
can any one help me to select a suitable digital filtering method for an adc output which is used to measure the voltage output of a load cell ?

2. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
What do you want to filter? I understand that you want to filter the ADC data, but what do you mean? You want an average voltage over 30 reading? You want to only know the variance? To what end do you want the data filtered?

3. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
Filters, both analog and digital, can be specified with extraordinary precision. I would suggest that you educate yourself on methods of filter specification. Note that this is vastly different from, and far easier than, filter design and realization. The main benefit to you for doing this is that you will get exactly what you want and can verify that the implementation matches the requirements.

How about we start with the analog signal you are digitizing. What frequencies will the input be bounded by? what amplitude levels are we talking about? What are the sources of noise and or interference? What kind of filter topology do you anticipate: low pass, high pass, band pass?

Feb 19, 2009
6,357
718

5. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
An ADC "output" is a digital word inside the processor. The reason he asked for a digital filter is that it is too late for an analog filter after the conversion.

6. ### tgil New Member

May 18, 2011
19
4
An exponential moving average filter is a type of IIR digital filter that is really easy to implement. This is the formula out[n] = out[n-1]*(1-alpha) + in[n]*alpha

alpha is the averaging constant between zero and one. One means no filtering and close to zero means heavy filtering.

http://www.coactionos.com/embedded-...se-digital-filter-with-minimal-resources.html

7. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
What makes you think this is what the OP needs? He has not yet addressed that issue.

thatoneguy likes this.
8. ### ErnieM AAC Fanatic!

Apr 24, 2011
7,435
1,625
Well, it is what the OP asked for.

9. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
A suitable filtering method is what he asked for, which is ambiguous to say the least. So give us the justification for using an exponential moving average.

10. ### tgil New Member

May 18, 2011
19
4
I use the EMA filter for ADC input in many applications. I cannot be sure that it will work optimally for this application, but it is certainly something to consider.

11. ### Papabravo Expert

Feb 24, 2006
10,338
1,850
OK, that is a kind of empirical justification where you say It has worked for me sufficiently well that I don't need to look further. It does not answer the question of how much improvement it offers for the investment of resources. That is what I am getting at by asking the OP to "define his requirements". That is the only way to know when you are done. The requirements can change in the process, but you have to start somewhere. That is Engineering, anything else is pretentious.