IIR Filter
Libraries:
Motor Control Blockset /
Signal Management
Motor Control Blockset HDL Support /
Signal Management
Description
The IIR Filter block implements a discrete first-order infinite impulse response (IIR) filter on the specified input signal. The block supports fixed-point and floating-point data types. The block is also optimized for code generation when you use it with the model settings and configuration adopted by the examples shipped with Motor Control Blockset™.
It is recommended that you use a fixed-step discrete solver for this block to enable code generation and ensure accurate simulation.
Equations
You can configure the IIR filter by using the filter coefficient () block parameter to set the required cutoff frequency (fc) for the filter. Optionally, you can also provide the filter coefficient value through an input port.
If you know the cutoff frequency of the filter, you can compute the required filter coefficient using this equation:
The block also includes the option of displaying the cutoff frequency for a given filter coefficient and sample time on the block mask.
Use the Filter type parameter to configure the block either as a lowpass or highpass filter.
The following two equations describe how the block computes its output.
Lowpass Filter:
Highpass Filter:
where:
fc is the cutoff frequency of the IIR filter.
is the filter coefficient (0 < a ≤ 1).
is the output value at time .
is the output value at time .
is the input value at time .
is the input value at time .
Ts is the sample time of the IIR Filter block.
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2020a