(Posted last night but did not show up on the list?? - reposting) As i believe my filter need some explanation, i send a cpoy of my answer of a question from Stefan also to the list: At 13:15 1998-11-06 +0100, Stefan Sczekalla-Waldschmidt wrote: >Hi Morgan, > >while I understod how your filter works as a matter of principle, where >are the >new values injected ? directly below or above the middle values or >between the >adjacent values next to the injected ? Between the two by value most close positions : The filter holds a range of values: ( 6 pos in this example; 16 in posted code ) A -TOP B C D E F -BOTTOM where A =< B =< C =< D etc... The first thing th efilter do when called, is to compare the feed with the values in the array. The array is always sorted. For fastest performance the code compares the MSB untill they are close, then LSB. When you call feed the filter with NEW value C < NEW < B, it will be injected below B and C. As the value is higher then the majority of stored values (position is above middle of array), the filter decides that it is the lowest value in filter that shall be treshed. So, it shifts: E -> F (F get trashed) D -> E C -> D NEW -> C The result: A -TOP B NEW C D E -BOTTOM The operation is vice versa for feeds below array midpoint. Note that the stored values will always be sorted by value. After sorting it takes the average of the middle values in the array Here: ( NEW + C ) / 2 -> result What i did not mention before is that this filter also can give a good measure of the noise level by adding all values above middle and subtraction with all values below. >By the way reading swedish is well - call it a exercise for your >imagination - its sometimes funny-different or similar and requires >sometimes a lot of imagiantion - well and some words will stay >unrecognised from point of view of a german. > >I tryed to figure the coments out yesterday evening. Wow! :) >Did you use plain swedish or did you concatenate abbreviatons ? Mixture of swedish and english words (in labels) concatenated and mixed together in a wonderful blend ;) >What is the meaning of "om" =if ; german is closer: ob >did "som" means something like engl. "some [of]" NO. "som" = which [will/is] or something like that it can also mean as; like as, or german: "wie" Good luck with your language lesson :) /Morgan >Thanks a lot for posting the code. Posting is easy. To explain what i have done is another matter. ;) Good exercise too. /Morgan >Kind regards and good luck with your project, > > Stefan Sczekalla-Waldschmidt > ssw@oikossw.de Morgan Olsson ph +46(0)414 70741 MORGANS REGLERTEKNIK fax +46(0)414 70331 HLLEKS (in A-Z letters: "HALLEKAS") SE-277 35 KIVIK, SWEDEN mrt@iname.com ___________________________________________________________