Engee documentation

Biquad Filter

A model of biquadratic BIR filters.

biquad filter

Description

The Biquad Filter block 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 parameter settings window, the unit implements static filters with fixed coefficients.

Ports

Input

In - input data
vector | matrix

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Support for complex numbers: Yes.

Num - coefficients of numerator
matrix

Numerator coefficients of the biquadratic filter, given as a matrix 3 on , where is the number of sections of the biquadratic filter.

Dependencies

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Den - denominator coefficients
matrix

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

Dependencies

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Output

Out - filtered output data
vector | matrix

Filtered output signal returned as a vector or matrix.

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Support for complex numbers: Yes.

Parameters

Coefficient source - operating mode
Input port(s) (by default) | Dialog parameters

The Biquad Filter block can operate in two modes:

  • Input port(s) (by default) - enter information about the filter structure using the Filter structure parameter. The filter coefficients are input to the block through additional input ports, which are displayed on the block icon:

    • Num - numerator coefficients.

    • Den - denominator coefficients.

  • Dialog parameters - input information about the filter in the block settings window.

Filter structure - filter structure
Direct form I (by default) | Direct form II.

Specify the filter structure.

SOS Matrix (Mx6) - second order section matrix
[1 0.3 0.4 1 0.1 0.2] (by default) | ` matrix M by 6`

Define the matrix by 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 Coefficient source parameter to Dialog parameters.

Scale values - values of scaling factors
1 (by default) | scalar | vector

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 M is the second dimension of the SOS matrix.

  • If a scalar is specified, its value sets 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 filter section. 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 the Coefficient source parameter to Dialog parameters.

Initial conditions - initial states
0 (by default) | scalar | vector

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

biquad filter 1

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

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 Filter structure parameter to Direct form II.

Initial conditions on zeros side - initial conditions on zeros side
0 (by default) | scalar | vector.

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

biquad filter 2

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

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 Filter structure to Direct form I.

Initial conditions on poles side - initial conditions on poles side
0 (by default) | scalar | vector

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

biquad filter 3

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

The number of initial conditions that must 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 Filter structure to Direct form I.

Scale values mode - mode of setting scaling factors
Assume all are unity and optimise (by default).

If Assume all are unity and optimize is selected, all scaling factor values are removed.

Dependencies

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

Action when the a0 values of the SOS matrix are not one - action when the a0 values of the SOS matrix are not one
Warning (by default) | None | Error

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

When None is selected, the leading coefficients of are treated as 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 Coefficient source parameter to Dialog parameters.

Optimise unity scale values - optimize scale factors equal to unity
`enabled (by default)

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

Dependencies

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

Input processing - input data processing
Columns as channels (frame based) (by default).

Specify the way of input data processing. For input data in the form of a matrix to the value of 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.