On Thu, 12 Apr 2001, Peter Betts wrote: > Dale, > > > > FILT <-- FILT*(1-F) + NEW*F > > > ..... I keep thinking I can see how this > > works, but then I plug it into Excel and it doesn't work. > > the key is the statement > > > F is the filter fraction. > > A fraction is in the range 0 to 1 so it'll only look good in Excel if you > use values between 0 and 1 (say 0.75) I got all that, but didn't quite get where that number was coming from. > What you are simply doing is weighting the output result with a proportion > of the OLD output value and a proportion of the NEW input value. > > So FILT(N+1) = [ FILT(N) * (1-F)] + [ INPUT(N) * F ] > > Where INPUT is obviously your new input sample of the period or whatever. > > Example: If N=3 (3rd sample) and F=0.75 then... > > FILT(4) = [ FILT(3) * (0.25)] + [ INPUT(3) * 0.75 ] > > So it's taking 75% of the new input and 25% of the previous output to > calculate the new output. > > If you want the filter to react quickly then F is large but it is also > susceptable to noise and variations in the error of the input and filtering > is small. In the limit where F is 1 the output becomes the input and you get > no filtering. NOW I get it. *I* pick F, arbitrarily, depending on how I want the filter to act. Thanks. That was the piece I was missing. Now it makes sense, and I can see where I was getting of track. Dale --- The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" (I found it!) but "That's funny ..." -- Isaac Asimov -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads