class="resources"
Applies a median filter of rank to the input sequence X. Details Example

![]() |
X is the input signal to filter.
The number of elements, n, in X must be greater than the rank, n > rank 0. If the number of elements in X is less than or equal to rank, the VI sets Filtered X to an empty array and returns an error.
|
![]() |
rank must be greater than or equal to zero. The default is 2. If rank is less than zero, the VI sets the output Filtered X to an empty array and returns an error. |
![]() |
Filtered X is the output array of filtered samples. The size of this array is the same as the input array X. |
![]() |
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster. |
The Median Filter VI obtains the elements of Filtered X using the following equation.
yi = Median(Ji) for i = 0, 1, 2, , n 1,
where Y represents the output sequence Filtered X, n is the number of elements in the input sequence X, Ji is a subset of the input sequence X centered about the ith element of X, and the indexed elements outside the range of X equal zero. Ji is given by the following equation.
Ji = {xi r, xi r + 1 , xi 1, xi, xi + 1 , xi + r 1, xi + r},
where r is the filter rank.
Refer to the Median Filtering VI in the labview\examples\analysis\fltrxmpl.llb directory for an example of using the Median Filter VI.