Engee documentation

Biquad Filter

A model of biquadratic BIR filters.

biquad filter

Description

Unit Biquad Filter independently filters each channel of the input signal using the specified biquadratic filter with infinite impulse response (IIR). When filter coefficients are specified in the parameters settings window, the unit implements static filters with fixed coefficients.

Ports

Input

# In - input data
vector | matrix

Details

Input data for a block, specified as a vector or matrix.

Типы данных

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Support for complex numbers

Yes

# Num - numerator coefficients
matrix

Details

The coefficients of the numerator of the biquadratic filter given as a matrix 3 at , where is the number of sections of the biquadratic filter.

Dependencies

To use this port, set the parameters for parameter Coefficient source value Input port(s).

Типы данных

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Support for complex numbers

No

# Den - denominator coefficients
matrix

Details

The denominator coefficients of the biquadratic filter given as matrix 2 at , where is the number of sections of the biquadratic filter.

Dependencies

To use this port, set the parameters to Coefficient source value Input port(s).

Типы данных

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Support for complex numbers

No

Output

# Out - filtered output data
vector | matrix

Details

A filtered output signal returned as a vector or matrix.

The output signal dimension is always equal to the input signal dimension.

Типы данных

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Support for complex numbers

Yes

Parameters

Main

# Coefficient source — filter coefficient source
Input port(s) | Dialog parameters

Details

block Biquad Filter can operate in two modes:

  • Input port(s) - filter coefficients are supplied to the block through additional input ports, which are displayed on the block icon:

    • Num - numerator coefficients.

    • Den - denominator coefficients.

  • Dialog parameters - filter coefficients are set through block parameters.

Values

Input port(s) | Dialog parameters

Default value

Input port(s)

Program usage name

CoefficientSource

Tunable

No

Evaluatable

No

# Filter structure — filter structure
Direct form I | Direct form II

Details

Specify the structure of the filter.

Values

Direct form I | Direct form II

Default value

Direct form I

Program usage name

FilterStructure

Tunable

No

Evaluatable

No

# SOS Matrix (Mx6) — second-order section matrix
Array of real numbers

Details

Set the matrix to 6, where is the number of sections in the second-order section (SOS) filter. Each row of the SOS matrix contains the numerator and denominator coefficients ( and ) of the corresponding filter section:

The leading coefficients of the denominator are equal to one regardless of their actual values. SOS matrix scaling is not applied if is not equal to one.

Dependencies

To use this parameter, set the parameters to Coefficient source value Dialog parameters.

Default value

[1 0.3 0.4 1 0.1 0.2]

Program usage name

SOSMatrix

Tunable

No

Evaluatable

Yes

# Scale values — scaling factors

Details

Specify the scaling factor values to be used between SOS sections. You can specify a scalar with a real value or a vector of length , where М is the second dimension of the SOS matrix.

  • If a scalar is specified, its value specifies the gain before the first section of the second order filter. Other gain values are set to 1 by default.

  • If a vector of values is specified, each value defines a different section of the filter. For example, the first element is the first gain value, the second element is the second gain value, and so on.

Dependencies

To use this parameter, set parameter Coefficient source value Dialog parameters.

Default value

1

Program usage name

ScaleValues

Tunable

No

Evaluatable

Yes

# Initial conditions on zeros side — initial states on the zero side
Real number

Details

Specify the initial states of the filter on the side of the filter structure with zeros ( , , , …​), if the parameter Filter structure is set to Direct form I.

biquad filter 2

Block Biquad Filter by default sets the internal filter states to zero. To set non-zero initial states for filter delays, use the parameters Initial conditions on zeros side.

The number of initial conditions to be set and how to set them are given in the table of acceptable initial conditions.

Initial condition Description

scalar.

Block sets the scalar value for all delay elements in the filter.

vector or matrix (to apply different delay elements to each channel)

Each vector or matrix element sets a unique initial condition for the corresponding delay element in the corresponding channel. - number of sections, - number of input channels:

* The length of the vector must be equal to the number of delay elements in the filter .

* The matrix should have as many rows as the number of delay elements in the filter . The matrix must also have one column for each input channel.

Dependencies

To use this parameter, set the parameters to Filter structure value Direct form I.

Default value

0

Program usage name

ZeroStates

Tunable

No

Evaluatable

Yes

# Initial conditions on poles side — initial states on the pole side
Real number

Details

Specify the initial states of the filter on the pole side of the filter structure ( , , …​), if the parameter Filter structure is set to Direct form I.

biquad filter 3

Block Biquad Filter by default sets the internal filter states to zero. To set non-zero initial states for filter delays, use the parameters Initial conditions on poles side.

The number of initial conditions to be set and how to set them are given in the table of acceptable initial conditions.

Initial condition Description

scalar.

Block sets the scalar value for all delay elements in the filter.

vector or matrix (to apply different delay elements to each channel)

Each vector or matrix element sets a unique initial condition for the corresponding delay element in the corresponding channel. - number of sections, - number of input channels:

* The length of the vector must be equal to the number of delay elements in the filter .

* The matrix should have as many rows as the number of delay elements in the filter . The matrix must also have one column for each input channel.

Dependencies

To use this parameter, set the parameters to Filter structure value Direct form I.

Default value

0

Program usage name

PoleStates

Tunable

No

Evaluatable

Yes

# Initial conditions — initial states
Real number

Details

Specify the initial states of the filter, if the parameters Filter structure is set to Direct form II.

biquad filter 1

Block Biquad Filter by default sets the internal filter states to zero. To set non-zero initial states for filter delays, use the parameters Initial conditions.

The number of initial conditions to be set and how to set them are given in the table of acceptable initial conditions.

Initial condition Description

scalar.

Block sets the scalar value for all delay elements in the filter.

vector or matrix (to apply different delay elements to each channel)

Each vector or matrix element sets a unique initial condition for the corresponding delay element in the corresponding channel. - number of sections, - number of input channels:

* The length of the vector must be equal to the number of delay elements in the filter .

* The matrix should have as many rows as the number of delay elements in the filter . The matrix must also have one column for each input channel.

Dependencies

To use this parameter, set parameter Filter structure value Direct form II.

Default value

0

Program usage name

InitialConditions

Tunable

No

Evaluatable

Yes

# Scale values mode — scaling factor setting mode
Assume all are unity and optimize

Details

If you select the option Assume all are unity and optimize all values of scaling factors are deleted.

Dependencies

To use this parameter, set the parameters to Coefficient source value Input port(s).

Values

Assume all are unity and optimize

Default value

Assume all are unity and optimize

Program usage name

ScaleValuesMode

Tunable

No

Evaluatable

No

# Action when the a0 values of the SOS matrix are not one — action if the values of a0 of the SOS matrix are not equal to one
None | Warning | Error

Details

Specify the action to be performed by the unit when the values of the SOS matrix are not equal to one. Values to select: Warning, None, Error.

When selecting None the leading coefficients are treated as one, regardless of their actual values. Scaling of the SOS matrix is not applied if is not equal to one.

Dependencies

To use this parameter, set the parameter Coefficient source value Dialog parameters.

Values

None | Warning | Error

Default value

Warning

Program usage name

ActionWhenTheA0Values

Tunable

No

Evaluatable

No

# Optimize unity scale values — optimisation of scaling factors equal to unity
Logical

Details

Select this check box to optimise the simulation when one or more scale factor values are equal to one. In this case, the unit scale factor values are removed.

Dependencies

To use this parameter, set parameter Coefficient source value Dialog parameters.

Default value

true (switched on)

Program usage name

OptimizeUnityScaleValues

Tunable

No

Evaluatable

No

# Input processing — input data processing
Columns as channels (frame based) | Elements as channels (sample based)

Details

Specify the method of input data processing. For input data in the form of a matrix to the value of the parameters Columns as channels (frame based) means that each column is treated as a separate channel. In this mode, the block creates instances of the same filter, each with its own independent state buffer. Each of the filters processes input samples at each Engee time step.

The value of the parameters Elements as channels (sample based) means that each element is treated as a separate channel. In this mode, the block creates instances of the same filter, each with its own independent state buffer. Each filter processes one input sample at each Engee time step.

Values

Columns as channels (frame based) | Elements as channels (sample based)

Default value

Columns as channels (frame based)

Program usage name

InputProcessing

Tunable

No

Evaluatable

No