Hello Tony, >Change: Filt <-- Filt + (New - Filt)*FFrac >to: Filt <-- Filt + ((New - Filt)+1)*FFrac >Assuming you truncate the result. >If FFRac is of another magnitude then change the '1' to >reflect it, i.e. FFRac=4 means that you should add 2 instead. >( i.e. an 'halfbit' of the output ). sorry but I don't get it. FFrac have to be between 0 and 1 right? (x/2) is the same as (x*0.5). So I don't know what you mean with FFrac=4, maybe (new-filt)/4? Your formula is great. It overcomes the problem of having to cast New and Filt variables to 16 bit, but it suffers from the same problem as Dave's. Filt <-- Filt + ((New - Filt)+1)/2 Filt <-- 1 + ((0 - 1)+1)/2 Filt <-- 1 + (0)/2 Filt <-- 1 My implementation solved this problem and don't have to deal with negative numbers: if (filt < new) filt = filt + ((new - filt)+1) / 2; else filt = filt - ((filt - new)+1) / 2; The only problem I've found if when going from 0 to 255 or from 255 to 0: filt = filt + ((new - filt)+1) / 2 filt = 0 + ((255 - 0)+1) / 2 <--- 255+1=256, it will roll to 0 filt = 0 + (0) / 2 filt = 0 <--- should be 255 Anyway, I can solve this doing 16 bit operations or (easier) with a couple of "if" clauses. Thank you very much, Brusque ----------------------------------------------------------------- Edson Brusque C.I.Tronics Lighting Designers Ltda Research and Development Blumenau - SC - Brazil Say NO to HTML mail www.citronics.com.br ----------------------------------------------------------------- -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body