hi guys, thank you for your help! Kris --- On Tue, 8/10/10, Spehro Pefhany wrote: From: Spehro Pefhany Subject: [PIC] Re: looking for a formula definition / naming To: "Microcontroller discussion list - Public." Received: Tuesday, August 10, 2010, 1:49 PM At 11:19 AM 10/08/2010, you wrote: >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)=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 (=20 >which is certainly for the bandwith ) > >Thank you Assume this routine is called periodically every Ts seconds (!), and assume that param >> 1, then you get a single-pole discrete-time IIR low pass filter with a cutoff frequency (3db down point) of: =A0 fc ~=3D 1/(2 * pi * Ts *param) For example, if param is 10 and Ts is 0.01 second, then your fc is about 1.6 Hz. 'param' is dimensionless. Google on "low pass filter", "discrete time" etc. if you want to know more. Best regards, Spehro Pefhany --"it's the network..."=A0 =A0 =A0 =A0 =A0 =A0 "The Journey = is the reward" speff@interlog.com=A0 =A0 =A0 =A0 =A0 =A0=A0=A0Info for manufacturers: http= ://www.trexon.com Embedded software/hardware/analog=A0 Info for designers:=A0 http://www.spef= f.com --=20 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 .