| 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 are always the same as those of the input signal that is filtered, 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.
The Discrete FIR Filter block initializes the internal filter states to zero by default, which is equivalent to 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 data type supported by Simulink except Boolean. The same types are supported for the numerator coefficients. The input states have the same data type as the block input.
The following diagrams show the filter structure and the data types used within the Discrete FIR Filter block for fixed-point signals.


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

Specify whether you want to input the filter coefficients on the block mask or inherit them from an input port.
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 Specifying Sample Time.
The Fixed-point pane of the Discrete FIR Filter block dialog appears as follows.

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 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
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
data type parameter.
See Using the Data Type Assistant for more information.
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
data type 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
data type 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 data
type parameter.
See Specifying Block Output Data Types for more information.
Select to lock scaling of outputs.
Select the rounding mode for fixed-point operations.
Select to have overflows saturate. Otherwise, they wrap.
Direct Feedthrough | Yes |
Sample Time | Specified in the Sample time parameter |
Scalar Expansion | Yes, of initial states |
States | |
Dimensionalized | Yes |
Zero Crossing | No |
![]() | Discrete Filter | Discrete State-Space | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |