FourthOrder Section Filter
Libraries:
DSP System Toolbox /
Filtering /
Filter Implementations
Description
The FourthOrder Section Filter block implements a cascade of fourthorder section filters in Simulink^{®}. You can specify the numerator and denominator coefficients of the filter in the block parameters dialog box or through input ports.
Examples
Ports
Input
x — Input signal
vector  matrix
Input signal, specified as a vector or a matrix. The input can be a variable size signal. That is, the frame size of the signal can change during simulation but the number of channels cannot.
This port is unnamed until you set the Coefficient source
parameter to Input ports
.
Data Types: single
 double
Complex Number Support: Yes
Num — Numerator coefficients
Pby5 matrix
Specify the numerator coefficients of the fourthorder section filter as a Pby5 matrix, where P is the number of filter sections. For more details on this input port, see Numerator coefficients of filter.
While the simulation is running, you can change the number of sections (rows) in the numerator coefficients. You can also change the coefficient values.
Dependencies
This port appears only when you set the Coefficient source
parameter to Input ports
.
Data Types: single
 double
Complex Number Support: Yes
Den — Denominator coefficients
Pby5 matrix  Pby4 matrix
Specify the denominator coefficients of the fourthorder section filter as a Pby5 matrix or a Pby4 matrix, where P is the number of filter sections. For more details on this input port, see Denominator coefficients of filter.
While the simulation is running, you can change the number of sections (rows) in the denominator coefficients. You can also change the coefficient values.
Dependencies
This port appears only when you set the Coefficient source
parameter to Input ports
.
Data Types: single
 double
Complex Number Support: Yes
Output
y — Filtered output
vector  matrix
Filtered output, returned as a vector or a matrix. The output has the same size and data type as the input. The output signal is complex if either the input signal, numerator coefficients, or the denominator coefficients are complex.
This port is unnamed until you set the Coefficient source
parameter to Input ports
.
Data Types: single
 double
Complex Number Support: Yes
Parameters
Coefficient source — Filter coefficient source
Dialog parameters
(default)  Input ports
 Filter object
Specify the filter coefficient source as one of the following:
Dialog parameters
–– Specify the filter coefficients through the Numerator coefficients of filter and the Denominator coefficients of filter parameters in the block dialog box.Input ports
–– Specify the filter coefficients through the Num and Den input ports.Filter object
–– Specify the filter coefficients using adsp.FourthOrderSectionFilter
object.
To view the filter response, set this parameter to Dialog
parameters
or Filter object
, and then click
the View Filter Response button.
Numerator coefficients of filter — Numerator coefficients
[0.07795634 0 0.15591268 0 0.07795634
;
0.06188520 0 0.12377039 0 0.06188520
] (default)  Pby5 matrix
Specify the numerator coefficients b of the fourthorder section filter as a Pby5 matrix, where P is the number of filter sections.
$$b=\left[\begin{array}{ccccc}{b}_{01}& {b}_{11}& {b}_{21}& {b}_{31}& {b}_{41}\\ {b}_{02}& {b}_{12}& {b}_{22}& {b}_{32}& {b}_{42}\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ {b}_{0P}& {b}_{1P}& {b}_{2P}& {b}_{3P}& {b}_{4P}\end{array}\right]$$
In the transfer function form, the fourthorder section filter can be represented using the following equation:
$$H(z)={\displaystyle \prod _{k=1}^{P}{H}_{k}}(z)={\displaystyle \prod _{k=1}^{P}\frac{{b}_{0k}+{b}_{1k}{z}^{1}+{b}_{2k}{z}^{2}+{b}_{3k}{z}^{3}+{b}_{4k}{z}^{4}}{{a}_{0k}+{a}_{1k}{z}^{1}+{a}_{2k}{z}^{2}+{a}_{3k}{z}^{3}+{a}_{4k}{z}^{4}}}$$
where,
a –– Denominator coefficients matrix. For more details on how to specify this matrix, see Denominator coefficients of filter.
k –– Row index.
You cannot change the size of this parameter during simulation, but you can change its value.
Tunable: Yes
Dependencies
To enable this parameter, set Coefficient source to
Dialog parameters
.
Data Types: single
 double
Complex Number Support: Yes
Denominator coefficients of filter — Denominator coefficients
[1 0 1.32091343 0 0.63273879
; 1 0
1.04859957 0 0.29614035
] (default)  Pby5 matrix  Pby4 matrix
Specify the denominator coefficients a of the fourthorder section filter as a Pby5 matrix or a Pby4 matrix, where P is the number of filter sections.
$$a=\left[\begin{array}{ccccc}{a}_{01}& {a}_{11}& {a}_{21}& {a}_{31}& {a}_{41}\\ {a}_{02}& {a}_{12}& {a}_{22}& {a}_{32}& {a}_{42}\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ {a}_{0P}& {a}_{1P}& {a}_{2P}& {a}_{3P}& {a}_{4P}\end{array}\right]$$
The block algorithm assumes that the value of the leading coefficients is always 1. If the denominator is of size Pby4, the block algorithm places 1s in the first column to make the denominator size Pby5. If the denominator is of size Pby5 and the elements in the first column do not equal 1, the algorithm ignores the values in the first column and appends them with 1s.
In the transfer function form, the fourthorder section filter can be represented using the following equation:
$$H(z)={\displaystyle \prod _{k=1}^{P}{H}_{k}}(z)={\displaystyle \prod _{k=1}^{P}\frac{{b}_{0k}+{b}_{1k}{z}^{1}+{b}_{2k}{z}^{2}+{b}_{3k}{z}^{3}+{b}_{4k}{z}^{4}}{{a}_{0k}+{a}_{1k}{z}^{1}+{a}_{2k}{z}^{2}+{a}_{3k}{z}^{3}+{a}_{4k}{z}^{4}}}$$
where,
b –– Numerator coefficients matrix. For more details on how to specify this matrix, see Numerator coefficients of filter.
k –– Row index.
You cannot change the size of this parameter during simulation, but you can change its value.
Tunable: Yes
Dependencies
To enable this parameter, set Coefficient source to
Dialog parameters
.
Data Types: single
 double
Complex Number Support: Yes
Filter — Filter object
dsp.FourthOrderSectionFilter
object
Specify the filter coefficients using a dsp.FourthOrderSectionFilter
object. You can enter this object directly in
the Filter parameter. Alternatively, you can create this object in
the MATLAB^{®} workspace or model workspace and specify the filter variable in the
Filter parameter. When you specify the filter as a variable and
you simulate the model, you cannot change the complexity, data type, and size of the
filter coefficients in the workspace between simulations.
Dependencies
To enable this parameter, set Coefficient source to
Filter object
.
View Filter Response — Visualize frequency response
gui button
Click this button to open the Dynamic Filter Visualizer window and display the
magnitude and phase response of the fourthorder section filter. The response is based
on the coefficients that you specify in the block dialog box. If you set
Coefficient source to Input ports
and
click Apply, you cannot view the magnitude response using this
button. To view the response in the visualizer, you must specify the filter coefficients
directly in the block dialog box or through the
dsp.FourthOrderSectionFilter
object.
To update the filter response while the visualizer is running, modify the coefficients in the block dialog box and click Apply.
You can configure the plot settings and the frequency response measurements from the interface of the visualizer.
On the Plot tab, you can enable the legend, specify to plot both magnitude and phase responses of the filter, modify the plot settings, generate a script to recreate the plot, and even save or share the settings.
On the Measurements tab, you can enable data cursors, and display the peak values of the filter response.
For more details on the Dynamic Filter Visualizer interface and its tools, see Configure Filter Visualizer.
Simulate using — Type of simulation to run
Interpreted execution
(default)  Code generation
Type of simulation to run. You can set this parameter to:
Interpreted execution
: Simulate model using the MATLAB interpreter. This option shortens startup time.Code generation
: Simulate model using generated C code. The first time you run a simulation, Simulink generates C code for the block. The C code is reused for subsequent simulations as long as the model does not change. This option requires additional startup time but provides faster subsequent simulations.
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2022aR2022b: Enhancements to FourthOrder Section Filter block
Starting in R2022b, when you pass numerator and denominator coefficients through the input ports of the FourthOrder Section Filter block, you can change the number of sections (rows) in the filter coefficients while the simulation is running.
You can also specify the coefficients in the block dialog box using a dsp.FourthOrderSectionFilter
object. Set Coefficient source
to Filter object
and specify a
dsp.FourthOrderSectionFilter
object directly in the
Filter parameter. Alternatively, you can create this object in the
MATLAB workspace or model workspace and specify the filter variable in the
Filter parameter.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)