Bitonic filter

A filter for preserving any bitonic information in signals or images.


Updated 8 Sep 2021

View License

Note that,for images, this filter has been superceded by the Locally Adaptive Bitonic X Filter, also available on file exchange.
This is a filter for removing noise in signals and images whilst preserving edges and other bitonic data, ie. anything with either one local maximum or minimum within the range of the filter. It has better edge-preserving properties than a median filter, whilst also removing noise similarly to a Gaussian filter. It has wide applicability and very few parameters, with no need for training or prior knowledge of the noise variance, and is hence particularly suited to situations where the noise is varying.
See the bitonic_demo script for an example.
Also included is RANKFILT2, which is a faster replacement for ORDFILT2 when the data is of type uint8.
More information is available from a technical report at:

Cite As

Graham Treece (2023). Bitonic filter (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Documentation change

Change to description.

Minor correction to rankfilt2.cpp which makes filtering more efficient in some cases.

Added link to technical report.

Updated the description to include rankfilt2.