Median Filter
R2026bMedian filter
Libraries:
DSP System Toolbox /
Filtering /
Filter Designs
DSP System Toolbox /
Statistics
Description
The Median Filter block computes the moving median of the input signal along each channel independently over time. The block uses the sliding window method to compute the moving median. In this method, a window of specified length moves over each channel sample by sample, and the block computes the median of the data in the window. This block performs median filtering on the input data over time.
You can change the window length during simulation by selecting the Make window length tunable parameter. Specify the tunable window length from the block dialog box by updating the Window length parameter or through the input port WL by selecting the Specify window length from input port parameter. For more details, see Algorithms. (since R2026b)
Ports
Input
Output
Parameters
Block Characteristics
Data Types |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Algorithms
Extended Capabilities
Version History
Introduced in R2016bSee Also
Blocks
- Median | Moving RMS | Moving Maximum | Moving Minimum | Moving Standard Deviation | Moving Variance | Moving Average
![Sliding window method for moving median with window length 4 and input samples [−1, −2, 3, 2, 5, 2]. At each time step n=0 through n=5, the window fills with zeros until length 4 is reached, then moves along the data. Median filter computes output for each window position, producing values 0.00, −0.50, −0.50, 0.50, 2.50, 2.50 at n=5](movmed_slidewin.png)