Hi, Edson Brusque wrote: > 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 =3D filt + ((sig16)new - (sig16)filt) / 2; > > The value never goes to 255 because of integer roundings: > filt =3D 254 + (255 - 254) / 2; > filt =3D 254 + (1)/2; > filt =3D 254; Well this is one of the drawbacks with (standard) IIR filters, you're only affecting 1/x part of the difference to the output each pass. In this case it easy: 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=3D4 means that you should add 2 instead. ( i.e. an 'halfbit' of the output ). /Tony -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body