So, this might be a good time to recap. Method 1: FILT <-- FILT + FF(NEW - FILT) Requires: 2 add/subtracts 1 multiply/divide/shift Method 2: Total =3D Total + New - Filt Filt =3D Total / Factor Requires: 2 add/subtracts 1 multiply/divide/shift Rounding instead of truncating requires 1 extra add in each case. The difference is in the format of the answer, binary vs. 10.6, and one ext= ra variable in method 2 which holds the filtered value in 10 bit binary for= mat. Is that a fair assessment? Kerry Olin Lathrop wrote: > Kerry Wentworth wrote: > =20 >> My Filt is the Total (or your Filt) right justified and truncated (or >> rounded) to 10 bits, to give a filtered A/D between 0 and 1023. >> =20 > > Yes. > > =20 >> This step is optional, if one wanted the 14 bit number, one could >> skip the conversion. >> =20 > > No, not with your algorithm, since it requires your FILT in a previous st= ep. > > It is optional in the normal method that I described. You can convert to > the original integer scale when you want, but are not forced to do so eac= h > iteration. More likely, you adjust the scale factors in the rest of the > system so no conversion is ever required. Usually the A/D values are in > some arbitrary scale, so having values in that scale times 2**N is no > different in that it's just as arbitrary. > > =20 >> And your FF(NEW - FILT) is really (NEW - FILT) / FF. >> Is this correct? >> =20 > > Clearly not if FF can take on values other than 1, which of course it can= .. > As I said before, useful values for FF are between 0 and 1. For easy > implementation on small systems, FF =3D 2**-N since the multiply by FF th= en > becomes a right shift by N. > > > ******************************************************************** > Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products > (978) 742-9014. Gold level PIC consultants since 2000. > =20 --=20 Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.289 / Virus Database: 267.11.13 - Release Date: 10/6/05 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .