Hi Morgan, > The filter can therefor be speeded up if the scan-for-adjacent-values > routine first checks if input is higher or lower than the filter median, > and then start the search from the relevant end, towards center. My Idea how to speed up the search is: new_input := tyngd_in size := size_of(viktfilter_array) rrf size; ; half array movf size, w movwf FSR loop movef INDF, W rrf size ; quarter array IS W > new_input add size to fsr else sub size from fsr if W = new_input or size = 0 fsr contains address where to inject new input else goto loop or to try this in a more textual way: if you test for higher or lower the value in the middle, then you know in which half the value has to be. now test higher or lower in the middle of the appropriate half. gives you the quarter where the value will be, now devide the quarter in two segmemts again checking for higher or lower until you4re just have two values left where the new value can be between. gives you the address where to inject. sorry for the pseudeo code but the Idea came very recently into my mind. I also think there is a quite better way to describe this algorithm. It4s like descending a binary tree. kind regards Stefan Sczekalla-Waldschmidt ssw@oikossw.de