MedianFilter

class MedianFilter(size: Int)(source)

A class that implements a moving-window median filter. Useful for reducing measurement noise, especially with processes that generate occasional, extreme outliers (such as values from vision processing, LIDAR, or ultrasonic sensors).

Parameters

size

The number of samples in the moving window.

Constructors

Link copied to clipboard
constructor(size: Int)

Functions

Link copied to clipboard
fun calculate(next: Double): Double

Calculates the moving-window median for the next value of the input stream.

Link copied to clipboard

Returns the last value calculated by the MedianFilter.

Link copied to clipboard
fun reset()

Resets the filter, clearing the window of all elements.