not some special method, just taking each measurement and adding it to 1d array. E.g. 3 element kernel array {1,2,1}. First measurement gave 33, second measurement 34. Array elements from 32 to 35 become {1,3,3,1}. Third time measured 34 again. Array elements from 32 to 35 {1,4,5,2}. Fourth time measured 38. Array elements from 32 to 39 {1,4,5,2,0,1,2,1} and so on. Then finding peak, in the above array peak is at element 34 (hist[34]=5) and it is not affected by noisy "38" value, even if it was "138". Sorry for such explanation.
My next attempt was to use sliding window of measurements. Oldest measurement substracted from histogram, newest was added. This required more memory, but provided more responsive readings. Actually, significantly less advanced what you guys doing here.
Next idea was to use larger histogram, and then use gaussian blur on this 1d line of pixels (to make non-zero derivatives for peak finding algorithm). During these experiments I thought on other problem and had an idea than input data for Kalman filter type models should be always filtered by using histograms. And one important advantage of histograms is absence of computations, only addition of kernel array to histogram array around certain element in a loop.