Version:

Last Modified: January 9, 2017

Applies a median filter of rank to a signal.

Rank is **right rank** if **right rank** is greater than zero. Rank is **left rank** if **right rank** is less than zero.

The input signal to filter.

The number of elements, *n*, in **signal** must be greater than **right rank**. If the number of elements in **signal** is less than or equal to **right rank**, the node sets **filtered signal** to an empty array and returns an error.

The number of elements used to compute the median filter to the left side.

**left rank** must be greater than or equal to 0.

**Default: **2

The number of elements used to compute the median filter to the right side.

If **right rank** is less than 0, the node assumes **right rank** is equal to **left rank**. **right rank** must be less than **signal**.

**Default: **-1

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

**Default: **No error

Filtered signal.

This node obtains the elements of **filtered signal** using the following equation.

${Y}_{i}=\mathrm{Median}\left({J}_{i}\right)\text{\hspace{0.17em}}\mathrm{for}\text{\hspace{0.17em}}i=0,\text{\hspace{0.17em}}1,\text{\hspace{0.17em}}2,\text{\hspace{0.17em}}\mathrm{...},\text{\hspace{0.17em}}n-1$

where

- Y represents
**filtered signal** *n*is the number of elements in**signal***J*_{i}is a subset of**signal**centered about the*i*^{th}element of**signal**- the indexed elements outside the range of
**signal**equal zero

The following equation describes *J*_{i}.

${J}_{i}=\{{X}_{i-rl},{X}_{i-rl+1},K,{X}_{i-1},{X}_{i},{X}_{i+1},K,{X}_{i+rr-1},{X}_{i+rr}\}$

where rl is the filter **left rank**, and rr is the filter **right rank**.

The following illustration shows the computation of *Y*_{i}.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported