| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Discrete

The Discrete FIR Filter block independently filters each channel of the input signal with the specified digital FIR filter. The block can implement static filters with fixed coefficients, as well as time-varying filters with coefficients that change over time. You can tune the coefficients of a static filter during simulation.
This block filters each channel of the input signal independently over time, treating each element of the input as an individual channel. The output dimensions equal those of the input, except in single-input/multi-output mode.
The outputs of this block numerically match the outputs of the Signal Processing Blockset Digital Filter Design block and of the Signal Processing Toolbox dfilt function.
This block supports the Simulink state logging feature. See States in the Simulink User's Guide for more information.
You can change the filter structure implemented with the Discrete FIR Filter block by selecting one of the following from the Filter structure parameter:
Direct form
Direct form symmetric
Direct form antisymmetric
Direct form transposed
Lattice MA
You must have an available Signal Processing Blockset software license to run a model with any of these filter structures other than direct form.
The Discrete FIR Filter block initializes the internal filter states to zero by default, which has the same effect as assuming that past inputs and outputs are zero. You can optionally use the Initial states parameter to specify nonzero initial conditions for the filter delays.
To determine the number of initial states you must specify and how to specify them, see the table on valid initial states. The Initial states parameter can take one of the forms described in the next table.
Valid Initial States
| Initial Condition | Description |
|---|---|
Scalar | The block initializes all delay elements in the filter to the scalar value. |
Vector or matrix | Each vector or matrix element specifies a unique initial condition for a corresponding delay element in a corresponding channel:
|
The Discrete FIR Filter block accepts and outputs real and complex signals of any numeric data type supported by Simulink. The bock supports the same types for the numerator coefficients.
The following diagrams show the filter structure and the data types used within the Discrete FIR Filter block for fixed-point signals.
You cannot specify the state data type on the block mask for this structure because the input states have the same data types as the input.


You cannot specify the state data type on the block mask for this structure because the input states have the same data types as the input.
It is assumed that the filter coefficients are symmetric. The block only uses the first half of the coefficients for filtering.



You cannot specify the state data type on the block mask for this structure because the input states have the same data types as the input.
It is assumed that the filter coefficients are antisymmetric. The block only uses the first half of the coefficients for filtering.



States are complex when either the inputs or the coefficients are complex.




The Main pane of the Discrete FIR Filter block dialog box appears as follows.

Specify whether you want to input the filter coefficients on the block mask or inherit them from an input port.
Select the filter structure you want the block to implement. You must have an available Signal Processing Blockset software license to run a model with a Discrete FIR Filter block that implements any filter structure other than direct form.
Specify the vector of numerator coefficients of the filter's transfer function.
This parameter is only visible when Dialog parameters is selected for the Coefficient source parameter.
Specify the initial conditions of the filter states. To learn how to specify initial states, see Specifying Initial States.
Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See How to Specify the Sample Time.
The Data Type Attributes pane of the Discrete FIR Filter block dialog box appears as follows.

Specify the tap sum data type of a direct form symmetric or direct form antisymmetric filter, which is the data type the filter uses when it sums the inputs prior to multiplication by the coefficients. You can set it to:
A rule that inherits a data type, for example, Inherit: Same as input
A built-in integer, for example, int8
A data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, fixdt(1,16,0)
This parameter is only visible when the selected filter structure is either Direct form symmetric or Direct form antisymmetric.
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Tap sum parameter.
See Using the Data Type Assistant for more information.
Specify the coefficient data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Same word length as input
A built-in integer, for example, int8
A data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, fixdt(1,16,0)
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Coefficient parameter.
See Using the Data Type Assistant for more information.
Specify the minimum value that a filter coefficient should have. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:
Parameter range checking (see Checking Parameter Values)
Automatic scaling of fixed-point data types
Specify the maximum value that a filter coefficient should have. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:
Parameter range checking (see Checking Parameter Values)
Automatic scaling of fixed-point data types
Specify the product output data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Inherit via internal rule
A built-in data type, for example, int8
A data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, fixdt(1,16,0)
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Product
output parameter.
See Using the Data Type Assistant for more information.
Specify the accumulator data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Same as product output
A built-in data type, for example, int8
A data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, fixdt(1,16,0)
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Accumulator parameter.
See Using the Data Type Assistant for more information.
Specify the state data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Same as accumulator
A built-in integer, for example, int8
A data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, fixdt(1,16,0)
This parameter is only visible when the selected filter structure is Lattice MA.
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the State parameter.
See Using the Data Type Assistant for more information.
Specify the output data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Same as accumulator
A built-in data type, for example, int8
A data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, fixdt(1,16,0)
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Output parameter.
See Specifying Block Output Data Types for more information.
Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Select to lock all data type settings of this block against changes by the Fixed-Point Tool and the Fixed-Point Advisor. For more information, see Fixed-Point Tool and Fixed-Point Advisor in the Simulink Fixed Point documentation.
Select the rounding mode for fixed-point operations. For more information, see Rounding in the Simulink Fixed Point User's Guide.
Select to have overflows saturate. Otherwise, they wrap.
When you select this check box, saturation applies to every internal operation on the block, not just the output or result. In general, the code generation process can detect when overflow is not possible, in which case, no saturation code is necessary.
Direct Feedthrough | Yes |
Sample Time | Specified in the Sample time parameter |
Scalar Expansion | Yes, of initial states |
States | |
Dimensionalized | Yes |
Zero-Crossing Detection | No |
![]() | Discrete Filter | Discrete State-Space | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |