Discrete Filter Function

Simulation VI and Function

Discrete Filter Function

Owning Palette: Discrete Linear Systems Functions

Installed With: Control Design and Simulation Module

Computes an infinite impulse response (IIR) filter or finite impulse response (FIR) filter with forward and backward coefficients. The Numerator and Denominator parameters define these coefficients.

Details  Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
 Place on the block diagram  Find on the Functions palette

Dialog Box Options

ParameterDescription
Polymorphic instanceSpecifies whether this function is single-input single-output (SISO) or multiple-input multiple-output (MIMO). The default value is SISO.
FeedthroughConfigures the function to be either a Direct or Indirect feedthrough function. Enable this control by selecting a parameter from the Parameters list and then selecting Terminal from the Parameter source pull-down menu. If you select Configuration Dialog Box from the Parameter source pull-down menu, LabVIEW disables this control and calculates the feedthrough behavior automatically.

Refer to the Details section for a description of the parameters that determine the feedthrough behavior of this function.
ParametersLists all the parameters associated with this function. Select a parameter from this list to configure the parameter. When you select a parameter, the parameter and its associated Parameter source control appear in the Parameter Information section of the configuration dialog box.
PreviewDisplays a graphical preview, if available, of the function output or configuration.
Parameter InformationContains the parameters you can configure for this function. You must select a parameter from the Parameters list to make that parameter and its associated Parameter source control visible in the Parameter Information section of the configuration dialog box.
Parameter sourceSpecifies whether you configure this parameter using the Configuration Dialog Box or a Terminal on the simulation diagram. The default value is Configuration Dialog Box. If you select Terminal, LabVIEW displays an input for that parameter on the simulation diagram, and you can wire values to that input to configure this function programmatically. If you select Configuration Dialog Box, LabVIEW removes that input from the simulation diagram. You then must set the value for this parameter inside the configuration dialog box.
FilterSpecifies the filter in terms of numerator and denominator polynomial functions.
  • Numerator—Specifies the coefficients of the numerator polynomial function in ascending powers of z, where z is the z-transform variable.
  • Denominator—Specifies the coefficients of the denominator polynomial function in ascending powers of z, where z is the z-transform variable. The order of the Denominator must be greater than or equal to the order of the Numerator.
sample period (s)Specifies the length of the discrete time step, in seconds, of this function. If you enter a value of –1, this function inherits the discrete time step you specify for the simulation diagram. Otherwise, the value of sample period (s) must be a multiple of the discrete time step you specify for the simulation diagram. The default value of sample period (s) is 1.
sample skew (s)Specifies the length of time by which you want to delay the execution of this function. The default value is 0. The value of this parameter must satisfy the following relationship:

0 ≤ sample skew (s)sample period (s)
reset?Sets the model state(s) to 0, when TRUE.

Block Diagram Inputs

ParameterDescription
FilterSpecifies the filter in terms of numerator and denominator polynomial functions.
  • Numerator—Specifies the coefficients of the numerator polynomial function in ascending powers of z, where z is the z-transform variable.
  • Denominator—Specifies the coefficients of the denominator polynomial function in ascending powers of z, where z is the z-transform variable. The order of the Denominator must be greater than or equal to the order of the Numerator.
sample period (s)Specifies the length of the discrete time step, in seconds, of this function. If you enter a value of –1, this function inherits the discrete time step you specify for the simulation diagram. Otherwise, the value of sample period (s) must be a multiple of the discrete time step you specify for the simulation diagram. The default value of sample period (s) is 1.
sample skew (s)Specifies the length of time by which you want to delay the execution of this function. The default value is 0. The value of this parameter must satisfy the following relationship:

0 ≤ sample skew (s)sample period (s)
reset?Sets the model state(s) to 0, when TRUE.
input u(k)Specifies the input to this function.

Block Diagram Outputs

ParameterDescription
output y(k)Returns the output of this function.

Discrete Filter Details

This function uses the following equation to calculate the output:

whereb0bm are the coefficients of the numerator polynomial function
a0an are the coefficients of the denominator polynomial function
m is the order of the numerator
n is the order of the denominator
z is the z-transform variable

The Discrete Filter function is based completely on the Discrete Transfer Function function.

Feedthrough Behavior

The number of zeros that begin the Numerator and Denominator subparameters determine the feedthrough behavior of this function. Given c as the index of the first non-zero coefficient in the Numerator and d as the index of the first non-zero coefficient in the Denominator:

  • If c = d, all input/output pairs have direct feedthrough behavior.
  • If c > d, the following input/output pair has indirect feedthrough behavior.
    • input u(k)output y(k)
    All other input/output pairs have direct feedthrough behavior.
  • If c < d, LabVIEW returns an error.

When you use the configuration dialog box to configure c and d, LabVIEW verifies that the feedthrough behavior is correct. For example, if you set the Feedthrough parameter to Indirect, and you set c equal to d, LabVIEW changes the Feedthrough parameter to Direct.

If you set Numerator and Denominator programmatically, LabVIEW does not adjust the feedthrough behavior for you. You must ensure that you specify the proper feedthrough behavior for the Numerator and Denominator values you specify.

Example

Refer to the SimEx discrete filter VI in the labview\examples\Control and Simulation\Simulation\Discrete Linear directory for an example of using the Discrete Filter VI.

 Open example  Browse related examples