Table Of Contents

Median Filter (G Dataflow)

Version:
    Last Modified: March 15, 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.

    connector_pane_image
    datatype_icon

    reset

    A Boolean that specifies the initialization of the internal state of the node.

    True Initializes the internal state to zero.
    False Initializes the internal state to the final state from the previous call of this node.

    This node automatically initializes the internal state to zero on the first call and runs continuously until this input is True.

    This input is available only if you wire a double-precision, floating-point number to signal.

    Default: False

    datatype_icon

    signal

    Input signal to filter.

    This input accepts a double-precision, floating-point number or an array of double-precision, floating-point numbers.

    If you wire a 1D array of double-precision, floating-point numbers to signal, 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.

    datatype_icon

    left rank

    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

    datatype_icon

    right rank

    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

    datatype_icon

    error in

    Error conditions that occur before this node runs.

    The node responds to this input according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Default: No error

    datatype_icon

    filtered signal

    Filtered signal.

    This output can return a double-precision, floating point number or an array of double-precision, floating point numbers.

    datatype_icon

    error out

    Error information.

    The node produces this output according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Algorithm Definition

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

    Y i = Median ( J i ) for i = 0 , 1 , 2 , ... , n 1

    where

    • Y represents filtered signal
    • n is the number of elements in signal
    • Ji is a subset of signal centered about the ith element of signal
    • the indexed elements outside the range of signal equal zero

    The following equation describes Ji.

    J i = { X i r l , X i r l + 1 , K , X i 1 , X i , X i + 1 , K , X i + r r 1 , X i + r r }

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

    The following illustration shows the computation of Yi.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics