Designs filter coefficients for a smoothing filter. You can use this VI to design a moving-average FIR filter or an exponentially-averaging IIR filter.

The VI returns reverse coefficients and forward coefficients for direct connection to the IIR Filter VI, which is used to implement both FIR and IIR filters.


icon

Inputs/Outputs

  • cenum.png type

    type specifies the type of smoothing filter.

    0moving average (default)—Yields forward-only (FIR) coefficients.
    1exponential—Yields first-order IIR coefficients.
  • ci32.png half-width

    half-width specifies the half-width of the moving-average filter in samples.

    For a half-width of M, the full width of the moving-average filter is N = 1 + 2M samples. Therefore, the full width N is always an odd number of samples.

  • cenum.png shape

    shape specifies the shape of the moving-average filter.

    0rectangular (default)—All samples in the moving-average window are weighted equally in computing each smoothed output sample.
    1triangular—The moving weighting window applied to the samples is triangular with its peak centered in the middle of the window, ramping down symmetrically on both sides of the center sample.
  • cdbl.png time constant

    time constant specifies the time constant of the exponential-weighting filter in seconds.

  • cdbl.png fs

    fs specifies the sampling frequency in samples per second.

  • i1ddbl.png reverse coefficients

    reverse coefficients contains the reverse, or feedback, coefficients of an IIR filter.

  • i1ddbl.png forward coefficients

    forward coefficients contains the forward coefficients of an IIR filter.

  • ii32.png error

    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.