Do you have a math library of some sort to do 10.6 arithmetic? For example, a 1/2 scale left justified A/D reading would be 1000 0000 00.00 0000 and 1/16 would be 0000 0000 00.00 0100 The desired result is 0000 1000 00.00 0000 Doing a binary multiply would result in a value of 0. On the other hand, a 1/2 scale right justified A/D reading would be 0000 0010 00.00 0000 And doing a binary multiply by 1/16 would result in a value of 0000 1000 00.00 0000 which is correct. Please pardon my ignorance, I'm here to learn. Is 10.6 arithmetic=20 something that everybody but me uses? Is it an assembly language=20 thing? I use a C compiler almost exclusively. 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 .