Median Filter
Median filter.
blockType: MedianFilter
Path in the library:
|
Description
Block Median Filter calculates the moving median of the input signal on each channel independently over time. The block uses the sliding window method to calculate the sliding median. In this method, a window of a given length is moved through each channel sample by sample, and the block calculates the median of the data in the window. This block performs median filtering of the input data over time.
Ports
Input
Port_1 — data entry
column vector | vector-string | the matrix
The data used by the block to calculate the moving median. The block accepts real or complex multi-channel and multidimensional input data, that is, input data of dimension on , where and .
Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128
Support for complex numbers: Yes
Parameters
Window length — length of the sliding window
5 (by default) | a positive scalar integer
Window length defines the length of the sliding window in the samples.
Algorithms
Sliding window method
In the sliding window method, the output for each input sample is the median of the current sample and previous selections. — this is the length of the window in the samples.
To calculate the first output when there is not enough data in the window yet, the algorithm fills the window with zeros. As an example, to calculate the median value when the second input sample arrives, the algorithm fills the window zeros. Data vector, , then represents two data samples, followed by zero. This object performs median filtering of the input data over time.
Consider an example of calculating the sliding median of streaming input data using the usage of the sliding window method. The algorithm uses a window of length 4. With each incoming input sample, a window of length 4 moves along the data.
