> some months ago Olin posted the formula that changed DSP world: :) > Filt <-- Filt + (New - Filt)*FFrac > > Saddly, my 8 bit implementation have a problem that I can't surpass: > filt = filt + ((sig16)new - (sig16)filt) / 2; > > The value never goes to 255 because of integer roundings: > filt = 254 + (255 - 254) / 2; > filt = 254 + (1)/2; > filt = 254; > > There's a way to change this? I've tried to raise the resolution making: > filt = filt + ((sig16)new*2 - (sig16)filt*2 + 1) / 4; > > But got same results because: > filt = 254 + ((sig16)255*2 - (sig16)254*2 + 1) / 4; > filt = 254 + (510 - 508 + 1) / 4; > filt = 254 + (510 - 508 + 1) / 4; > filt = 254 + (1) / 4; > > Please, someone help me!!! It helps to have enough fraction bits so that 1/FFrac is not expressed as 0. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body