Running Max/Min Filters using 1+o(1) Comparisons per Sample
Related Experiment Video
Updated: May 29, 2026

Unraveling the Unseen Players in the Ocean - A Field Guide to Water Chemistry and Marine Microbiology
Published on: November 5, 2014
1City University of Hong Kong, Hong Kong.
Abstract:
A running max (or min) filter asks for the maximum or (minimum) elements within a fixed-length sliding window. The previous best deterministic algorithm (developed by Gil and Kimmel, and refined by Coltuc) can compute the 1D max filter using 1.5+o(1) comparisons per sample in the worst case. The best known algorithm for independent and identically distributed input uses 1.25+o(1) expected comparisons per sample(by Gil and Kimmel). In this work, we show that the number of comparisons can be reduced to 1+o(1) comparisons per sample in the worst case. As a consequence of the new max/min filters, the opening (or closing) filter can also be computed using 1+o(1) comparisons per sample in the worst case, where the previous best work requires 1.5+o(1) comparisons per sample (by Gil and Kimmel); and computing the max and min filters simultaneously can be done in 2+o(1) comparisons per sample in the worst case, where the previous best work (by Lemire) requires 3 comparisons per sample. Our improvements over the previous work are asymptotic, that is, the number of comparisons is reduced only when the window size is large.
Related Concept Videos
Upsampling
Bandpass Sampling
A bandpass signal has a spectrum with a lower frequency limit, denoted as ω1, and an upper frequency limit, denoted as ω2. The spectrum...
Sampling Methods: Overview
In analytical chemistry, the choice of sampling...
Sampling Continuous Time Signal
In the...
Multiple Comparison Tests
It would be easy to compare two samples using a significance alpha level of 0.05. In other words, there is only one sample pair to be compared. However, it would be difficult to identify a significantly different sample if the number...
Sampling Theorem