Engee documentation

Biquad Filter

A model of biquadratic BIR filters.

blockType: BiquadFilter

Path in the library:

/Signal Operations/Filters/Filter Implementations/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.

Data types

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

Data types

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

Data types

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.

Data types

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

Support for complex numbers

Yes

Parameters

Main

# Coefficient source — the source of the filter coefficients
Input port(s) | Dialog parameters

Details

Block Biquad Filter It can work in two modes:

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

    • Num — coefficients of the numerator.

    • Den — coefficients of the denominator.

  • Dialog parameters — the filter coefficients are set through the 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 filter structure.

Values

Direct form I | Direct form II

Default value

Direct form I

Program usage name

FilterStructure

Tunable

No

Evaluatable

No

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

Details

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

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

Dependencies

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

Default value

[1 0.3 0.4 1 0.1 0.2]

Program usage name

SOSMatrix

Tunable

No

Evaluatable

Yes

# Scale values — values of scale coefficients

Details

Specify the values of the scale factors to be used between the SOS sections. You can specify a scalar with a real value or a vector of length. , where – 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. The other default gain values are `1'.

  • If a vector is given from values, then each value defines a separate 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 for the parameter Coefficient source meaning Dialog parameters.

Default value

1

Program usage name

ScaleValues

Tunable

No

Evaluatable

Yes

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

Details

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

biquad filter 2

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

The number of initial conditions that need to be set and the method of setting them are shown in the table of acceptable initial conditions.

The initial condition Description

scalar

The 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 element of the matrix 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 there are delay elements in the filter. . The matrix should also have one column for each input channel.

Dependencies

To use this parameter, set for the parameter Filter structure meaning Direct form I.

Default value

0

Program usage name

ZeroStates

Tunable

No

Evaluatable

Yes

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

Details

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

biquad filter 3

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

The number of initial conditions that need to be set and the method of setting them are shown in the table of acceptable initial conditions.

The initial condition Description

scalar

The block sets the scalar value for all delay elements in the filter.

vector or `matrix' (for applying different delay elements to each channel)

Each vector or element of the matrix 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 there are delay elements in the filter. . The matrix should also have one column for each input channel.

Dependencies

To use this parameter, set for the parameter Filter structure meaning Direct form I.

Default value

0

Program usage name

PoleStates

Tunable

No

Evaluatable

Yes

# Initial conditions — initial states
Real number

Details

Specify the initial filter states if for the parameter Filter structure the value is set Direct form II.

biquad filter 1

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

The number of initial conditions that need to be set and the method of setting them are shown in the table of acceptable initial conditions.

The initial condition Description

scalar

The block sets the scalar value for all delay elements in the filter.

vector or `matrix' (for applying different delay elements to each channel)

Each vector or element of the matrix 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 there are delay elements in the filter. . The matrix should also have one column for each input channel.

Dependencies

To use this parameter, set for the parameter Filter structure meaning Direct form II.

Default value

0

Program usage name

InitialConditions

Tunable

No

Evaluatable

Yes

# Scale values mode — setting mode for scale coefficients
Assume all are unity and optimize

Details

When selecting an option Assume all are unity and optimize all scale factor values are deleted.

Dependencies

To use this parameter, set for the parameter Coefficient source meaning 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 that the block should perform when the values of the SOS matrix are they are not equal to one. Values to choose from: Warning, None, Error.

When choosing None leading coefficients They are considered as a unit, regardless of their actual values. SOS matrix scaling is not applied if not equal to one.

Dependencies

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

Values

None | Warning | Error

Default value

Warning

Program usage name

ActionWhenTheA0Values

Tunable

No

Evaluatable

No

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

Details

Select this option to optimize the simulation when one or more scale factor values are equal to one. In this case, the values of the individual scale factors are deleted.

Dependencies

To use this parameter, set for the parameter Coefficient source meaning 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 input data processing method. For input data in the form of a matrix on parameter value Columns as channels (frame based) This 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 status buffer. Each of the filters are processed input samples at each time step Engee.

Parameter value Elements as channels (sample based) This 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 status buffer. Each filter processes one input sample at each time step Engee.

For more information, see Signal processing by frames and counts.

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