Design and implement digital FIR and IIR filters
DSP System Toolbox / Filtering / Filter Implementations
Use this block to design, analyze, and efficiently implement floating-point filters.
The Digital Filter Design block implements a digital Finite Impulse Response (FIR) or
Infinite Impulse Response (IIR) filter that you design by using the Filter
filterDesigner) app. This block provides
the same filter implementation as the Discrete FIR Filter or Biquad Filter
You must specify whether the block performs frame-based or sample-based processing on the input
by setting the Input processing parameter. The block applies the
specified filter to each channel of a discrete-time input signal and outputs the result.
The outputs of the block numerically match the outputs of the Discrete FIR Filter or
Biquad Filter block and the MATLAB®
filter function. For more information,
see Getting Started with Filter Designer.
These blocks also implement digital filters, but serve slightly different purposes:
Discrete FIR Filter (Simulink) and Biquad Filter— Use to efficiently implement floating-point or fixed-point filters that you have already designed. These blocks provide the same exact filter implementation as the Digital Filter Design block.
Filter Realization Wizard — Use to implement floating-point or fixed-point filters built from Sum, Gain, and Unit Delay blocks. You can either design the filter within this block, or import the coefficients of a filter that you designed elsewhere.
Port_1— Input signal
Signal to filter, specified as a vector or matrix of real values. When given matrix input, the block treats each column as an independent channel.
The sample rate,
Fs, that you specify in the
filter designer app must be identical to the sample rate of the input to
the Digital Filter Design block. When the sampling frequencies do not
match, the Digital Filter Design block returns a warning message and
inherits the sample rate of the input block.
Port_1— Output signal
Filtered signal, returned as a vector or a matrix of real values.
For more information about the parameters in this dialog box, see Getting Started with Filter Designer.
To open filter designer, double-click the Digital Filter Design block. Use the filter designer to design or import a digital FIR or IIR filter. To learn how to design filters with this block and filter designer, see:
You can tune the filter specifications in filter designer during simulations if your changes do not modify the filter length or filter order. As you apply any filter changes in filter designer, the filter is updated.
Generated code relies on
memset functions (
string.h) under certain
The Digital Filter Design block supports SIMD code generation using Intel AVX2 technology under these conditions:
Input processing is set to
as channels (frame based).
Filter Structure (in Import Filter from
Workspace pane) is set to
FIR. You can generate SIMD code even when the filter
Direct-Form FIR Transposed filter. To
Direct-Form FIR Transposed filter,
select Edit > Convert
Structure, and click Direct-Form FIR
Input signal has a data type of
The SIMD technology significantly improves the performance of the generated code.