# Filtering (Continuous) (G Dataflow)

Version:

Continuously filters an input sequence using a specific filter.

## 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.

Default: False

## signal

Input signal to filter.

This input accepts the following data types:

• Waveform
• Double-precision, floating-point number
• Complex double-precision, floating-point number
• 1D array of waveforms
• 1D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers

## filter

The input filter.

### filter structure

Structure of the filter.

Name Value Description
IIR Cascade 2nd Order 0 Uses IIR second-order filter stages.
IIR Cascade 4th Order 1 Uses IIR fourth-order filter stages.
IIR Direct 2 Uses the direct-form IIR filter.
FIR 3 Uses the FIR filter.

### forward coefficients

Forward coefficients of the filter.

Default: 0

### reverse coefficients

Reverse coefficients of the filter.

Default: 0

### sampling frequency

The sampling frequency in Hz.

This value must be greater than zero.

Default: 0

## 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

## filtered signal

Filtered signal.

This output can return the following data types:

• Waveform
• Double-precision, floating-point number
• Complex double-precision, floating-point number
• 1D array of waveforms
• 1D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers
• 2D array of double-precision, floating-point numbers

## 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 for Obtaining Filtered Signal with the FIR Filter

If filter structure is FIR, this node obtains the elements of filtered signal using the following equation:

${y}_{i}=\begin{array}{cc}\underset{j=0}{\overset{{N}_{b}-1}{\sum }}{b}_{j}{x}_{i-j}& \mathrm{for}\left(i\ge 0\right)\end{array}$
where
• y is filtered signal
• Nb is the number of FIR coefficients
• bj is the filter coefficients

## Algorithm for Obtaining Filtered Signal with the IIR Filter

If filter structure is IIR Direct, this node obtains the elements of filtered signal using the following equation:

${y}_{i}=\begin{array}{cc}\frac{1}{{a}_{0}}\left(\underset{j=0}{\overset{{N}_{b}-1}{\sum }}{b}_{j}{x}_{i-j}-\underset{k=1}{\overset{{N}_{a}-1}{\sum }}{a}_{k}{y}_{i-k}\right)& \mathrm{for}\left(i\ge 0\right)\end{array}$
where
• y is filtered signal
• Nb is the number of forward coefficients
• bj is the forward coefficients
• Na is the number of reverse coefficients
• ak is the reverse coefficients

## Algorithm for Obtaining Filtered Signal with the IIR Cascade Filter

If filter structure is IIR Cascade 2nd Order or IIR Cascade 4th Order, this node obtains the elements of filtered signal with a cascade of second- or fourth-order filter stages. The output of one filter stage is the input to the next filter stage for all Ns filter stages.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices