Main Content

IIR Filter

Implement infinite impulse response (IIR) filter

  • 库:
  • Motor Control Blockset / Signal Management

Description

TheIIR Filterblock 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 used with the model settings and configuration adopted by the examples shipped in Motor Control Blockset™.

We recommend that you use 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 ( a ) block parameter for a given cutoff frequency (fc).

This equation describes computation of the filter coefficient from the cutoff frequency:

a = ( 2 π T s f c 2 π T s f c + 1 )

也或者,块计算系统结构ical cutoff frequency for the given sample time using a filter coefficient:

f c = ( a ( 1 a ) 2 π T s )

Use theFilter typeparameter to configure the block either as a low-pass or high-pass filter.

Low-pass filter:

y ( k ) = a x k + ( 1 a ) y k 1

High-pass filter:

y ( k ) = ( 1 a ) x k ( 1 a ) x k 1 + ( 1 a ) y k 1

where:

  • fcis the cutoff frequency of the IIR filter.

  • a is the filter coefficient in the range (0, 1].

  • y ( k ) is the filtered output value at time k .

  • y k 1 is the filtered output value at time k 1 .

  • x k is the sampled input value at time k .

  • x k 1 is the filtered output value at time k 1 .

  • Tsis the sample time of the IIR Filter block.

Ports

Input

expand all

Sampled values of the raw input signal in the time domain.

Data Types:single|double|fixed point

Output

expand all

Filtered output signal returned by the IIR Filter block in the time domain.

Data Types:single|double|fixed point

Parameters

expand all

Type of the IIR filter.

Filter coefficient of the IIR filter. The data type of this parameter is the same as that of the input signal. We suggest that you check the precision of the parameter value in this data type.

Select this parameter for the block to display theDiscrete step size (s)andTheoretical cutoff frequency (Hz)parameters.

Step size of the discrete-time computation (in seconds) used by the IIR filter.

Dependencies

来display this parameter, select the显示截止频率parameter.

Theoretical cutoff frequency (in Hertz) of the IIR filter. This parameter is not configurable.

Dependencies

来display this parameter, select the显示截止频率parameter.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced in R2020a