A new algorithm for real-time median filtering

An algorithm is presented to determine the median of a given set of samples W. The median is determined by making r comparisons of the elements of the "m-array," where r is the number of bits in the radix-2 representation of the largest element of W. The m-array has 2relements, and m k equals the number of samples of W greater than or equal to (k - 1). The method is suitable to determine the running median in median filtering since updating the m-array is a very simple task.