# Digital Filters for ADC output

#### priyersi

Joined Feb 25, 2013
9
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 ?

#### tshuck

Joined Oct 18, 2012
3,535
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?

#### Papabravo

Joined Feb 24, 2006
12,767
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?

#### thatoneguy

Joined Feb 19, 2009
6,359

#### Papabravo

Joined Feb 24, 2006
12,767
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.

#### tgil

Joined May 18, 2011
19

#### Papabravo

Joined Feb 24, 2006
12,767
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-design/109-an-easy-to-use-digital-filter-with-minimal-resources.html
What makes you think this is what the OP needs? He has not yet addressed that issue.

#### ErnieM

Joined Apr 24, 2011
8,011
What makes you think this is what the OP needs? He has not yet addressed that issue.
Well, it is what the OP asked for.

#### Papabravo

Joined Feb 24, 2006
12,767
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.

#### tgil

Joined May 18, 2011
19
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.

#### Papabravo

Joined Feb 24, 2006
12,767
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.