Configuration structures

General description

An individual configuration structure ST_FTR_<type> exists for each function block FB_FTR_<type>. In the configuration structure all parameters are defined that are required for the calculation of the transfer function, the input and output variables (size and form of the arrays) as well as the internal states.

Common parameters

All configuration structures ST_FTR_<type> contain the following parameters:

Parameter

Type

Description

nOversamples

UDINT

Number of oversamples > 0

nChannels

UDINT

Number of channels > 0 & < 101

pInitialValues

POINTER TO LREAL

Pointer to array with initial values (optional)

nInitialValuesSize

UDINT

Size of the array with initial values in BYTE (optional)

nOversamples and nChannels

The parameters nOversamples and nChannels describe the size of the input and output arrays that are transferred when the Call() method is called. If, for example, 10 oversamples and 3 channels are used, the Call() method expects an array with 30 elements at the input and output (see Oversampling and channels).

The parameter nChannels describes the number of parallel signal channels to be processed with a call. The parameter nOversamples describes the number of samples that occur for each individual channel and each call of the Call() method.

Inital Values

The optional parameters pInitialValues and nInitialValuesSize are used to define the internal state of the filter after its configuration. In practice, the parameters are used to reduce the settling time of the configured filter by introducing prior knowledge. For this purpose, the historical values y[n-k] and x[n-k] with k > 0 in the difference equation must be set in a targeted manner.

The following structure of the difference equation applies to the function blocks FB_FTR_IIRCoeff, FB_FTR_MovAvg, FB_FTR_PT1, FB_FTR_PT2 and FB_FTR_PT3:

Configuration structures 1:

For a more compact illustration, the following notations are used for the historical values: xi,k and yi,k, where channel i and time delay k > 0. Sample: Channel i = 2 and delay k = 3 corresponds to y2,3 = y2[n-3].

Application options:

For the function blocks FB_FTR_IIRSos and FB_FTR_IIRSpec, the transfer function is calculated in second-order sections (SOS):

Configuration structures 2:

The compact illustration is extended accordingly by m, which specifies the biquad: x(m)i,k and y(m)i,k. Sample: Channel i = 2 and delay k = 1 of the fourth biquad (m = 4) corresponds to
y(4)2,1 = y(4)2[n-1]. Each biquad can use only two historical values here; accordingly, k = 1.2.

Therefore, the structuring for the input and output values is different there.

Application options:

The function block FB_FTR_PTn is also described as a cascaded filter, but as a first-order cascaded filter. Accordingly, the same consideration as for the SOS blocks applies here, but with k = 1. For a PTn filter where n = M, the following then applies: