Harold, What you describe is an exponential decline (0.5, 0.25, 0.125, etc.) and this is a first-order IIR low pass filter. Sean On Tue, Aug 10, 2010 at 12:04 PM, Harold Hallikainen wrote: > >> On Tue, 10 Aug 2010 08:19:32 -0700 (PDT), "kris duff" said: >>> Hello, >>> >>> My colleage told me about a smoothing/lpf formula which is : >>> >>> a(n) =3D {a(n-1) * param + ADC} / {param + 1} >>> >>> which >>> ADC is the signal from adc >>> a(n-1)=C2=A0 is the result of the last call to this formula >>> the param is the part I don't understand. >>> >>> Is there anybody knows where this formula comes from ? >>> >>> it seems to work well for smoothing, but I want to tweek the param ( >>> which is certainly for the bandwith ) > > I have used this with param=3D0 (just use current ADC) and with param=3D1 > (mean of old value plus current adc). The param determines how much of ol= d > values you're using. It's interesting to look at a step response to this > LPF. If the ADC value goes from 1 to 0 in one sample, the output goes 1, > 0.5, 0.25, 0.125, etc. Note that it's a linear decline while a single pol= e > RC would be an exponential decline. > > Harold > > > > > -- > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising > opportunities available! > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .