Owning Palette: Filters VIs
Requires: Full Development System
Applies a median filter of rank to the input sequence X, where rank is right rank if right rank is greater than zero, or left rank if right rank is less than zero.
X is the input signal to filter. The number of elements, n, in X must be greater than right rank. If the number of elements in X is less than or equal to right rank, the VI sets Filtered X to an empty array and returns an error. | |
left rank is the number of elements used to compute the median filter to the left side. left rank must be greater than or equal to 0. The default is 2. | |
right rank is the number of elements used to compute the median filter to the right side. If right rank is less than 0, the VI assumes right rank is equal to left rank. right rank must be less than X. The default is -1. | |
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.
y_{i} = Median(J_{i}) 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, J_{i} is a subset of the input sequence X centered about the i^{th} element of X, and the indexed elements outside the range of X 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}.
Refer to the Median Filtering VI in the labview\examples\Signal Processing\Filters directory for an example of using the Median Filter VI.