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