• AVR Freaks

Running Average in AN1292 application note

Author
microLearner
Junior Member
  • Total Posts : 110
  • Reward points : 0
  • Joined: 2017/02/27 20:26:37
  • Location: 0
  • Status: offline
2019/10/04 23:13:17 (permalink)
0

Running Average in AN1292 application note

I have seen the following statement in the source code of the AN1292 application note
"Running average value of ADC-Ave is maintained and subtracted from ;  ADC value before scaling."
What is the importance of this running average? Can someone please explain me with an example how it will affect? Please advise.
#1

3 Replies Related Threads

    rodims
    Super Member
    • Total Posts : 1519
    • Reward points : 0
    • Joined: 2009/02/10 11:08:59
    • Location: 51.9627, 7.6262
    • Status: offline
    Re: Running Average in AN1292 application note 2019/10/05 06:34:33 (permalink)
    #2
    du00000001
    Just Some Member
    • Total Posts : 3076
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Running Average in AN1292 application note 2019/10/06 07:19:13 (permalink)
    0
    I didn't check vs. AN1292, but the rolling/moving/running/sliding average is a means to calculate the (short-term) mean value of some input.
    Especially the exponential form can be calculated with little effort as an IIR Filter
    O(t) = O(t-1) * (k - 1)/k + I(t) * 1/k        O: output value / buffer; I: input value
    Even less effort if k is a power of 2, reducing the divisions to shifting.
     
    So, following the calculation of the difference you're scaling the deviation from the mean value.
    post edited by du00000001 - 2019/10/06 07:22:13

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    NorthGuy
    Super Member
    • Total Posts : 5688
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: Running Average in AN1292 application note 2019/10/06 07:36:54 (permalink)
    4 (1)
    Moving average works as low-pass filter. If you have noisy signal which jumps up and down, you can average several consecutive ADC reading to produce more stable result.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5