Discrete FIR Filter HDL
A filter with a finite impulse response.
blockType: HDLDiscreteFIRFilter
Path in the library:
|
Description
Block Discrete FIR Filter HDL simulates finite-impulse response filter architectures optimized for HDL code generation. The block accepts scalar or frame data input, and supports multi-channel input. The unit provides a hardware-friendly interface with input and output control signals.
The block provides a fully parallel filtering implementation suitable for FPGA and ASIC applications (mode Direct form transposed).
Ports
Input
#
data
—
input data
scalar | column vector | vector string
Details
Input data specified as a scalar, column vectors, or row vectors of real or complex values.
You can use a vector string. [c1 c2 c3] to represent input samples for multiple channels in one cycle, or you can provide scalar multi-channel data with alternating channels: data sampling c1 in cycle 1, data sampling c2 in cycle 2, data sampling c3 in cycle 3. Channels can have independent filter coefficients.
Frame input (column vectors) is not supported for multi-channel coefficients. To implement a high-performance multi-channel filter, you can use the block For Each to implement a high-performance filter for each channel.
The size of the row vector or column vector must be less than or equal to 64 the elements. To implement a multi-channel filter with more than 64 For example, it is necessary to use alternating scalar input.
If the input data is of integer or fixed-point type, the block uses fixed-point arithmetic for internal calculations and provides parameters on the tab. Data Types to configure data types. If the input data is of a floating-point type, the block uses this type of floating-point input data for internal calculations and output data.
The software supports data types Float64 and Float32 for modeling, but not for HDL code generation.
| Data types |
|
| Complex numbers support |
Yes |
#
valid
—
indicates that the input data is correct
scalar
Details
A control signal indicating the correctness of the input data. If the port value valid is 1 (true), the block receives values from the input data port data. If the port value valid is 0 (false), the block ignores values from the data port.
| Data types |
|
| Complex numbers support |
No |
Output
#
data
—
filtered output data
scalar | column vector | vector string
Details
Filtered output data returned as a scalar, column vector, or row vector of real or complex values. The size of the output data corresponds to the size of the input data. If the input data is of a floating-point type, the output data inherits the input data type. If the input data is of integer or fixed-point type, the parameter Output on the tab Data Types controls the type of output data.
| Data types |
|
| Complex numbers support |
Yes |
#
valid
—
indicates the correctness of the output data
scalar
Details
A control signal indicating that the output data of the data port is correct. If the port value valid is 1 (true), the block returns correct data from the output port data. If the port value valid is 0 (false), the values from the output port data are incorrect.
| Data types |
|
| Complex numbers support |
No |
Parameters
Filter parameters
#
Coefficient source —
the source of the filter coefficients
Property
Details
You can set constant filter coefficients as a parameter (scalar, vector, or matrix of numbers).
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
# Coefficients — coefficients of a discrete FIR filter
Details
Coefficients of a discrete FIR filter, specified as a vector string of real or complex values. Multi-channel coefficients can be set using a matrix with the size on real or complex values, where — the number of channels, and — the length of the filter. To optimize the symmetry, the symmetry characteristics of all channels must be consistent. For example, if one channel has even symmetry, all channels must be even-symmetric.
You can also specify coefficients as a workspace variable or as a call to the filter design function. If the input data type is a floating-point number, the block converts the coefficients to the same data type as the input data. If the input data type is an integer or a fixed-point number, the data type for the coefficients can be set on the tab Data Types.
Dependencies
To use this parameter, set for the parameter Coefficient source meaning Property.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Filter structure —
HDL filter architecture
Direct form transposed
Details
Specify the architecture of the HDL filter as one of the following structures:
-
Direct form transposed— This architecture is a fully parallel implementation suitable for FPGA and ASIC applications. When specifying multi-channel coefficients in this architecture (with alternating input samples), the block alternates channel coefficients using a single parallel filter.
If any filter is symmetric, the architecture uses multipliers to match the coefficients, so in fact becomes equal . To optimize the symmetry of multi-channel filters, the symmetry characteristics of all channels must be consistent.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
Fixed-point operational parameters
#
Rounding mode —
rounding mode to adjust the output data to the selected data type
Zero
Details
Rounding mode for converting output data to the data type specified in the parameter Output. If the input data is of a floating-point type, the block ignores this parameter. You can choose:
-
Zero— rounds the number towards zero.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
Floating-point inheritance takes precedence over the data type settings in this section. When the block input is floating point, all block data types match the input.
#
Coefficients —
data type of discrete FIR filter coefficients
Same word length as input | Fixed-point
Details
If the input data is of a fixed point type or an integer type, the block converts the filter coefficients using the rule or data type specified in this parameter. The quantization is rounded to the nearest representable value and reaches saturation at overflow. If the input data is of a floating-point type, the block ignores this parameter, and all internal arithmetic operations use the same data type as the input data.
The recommended value for this parameter is: Same word length as input.
Dependencies
To use this parameter, set for the parameter Coefficient source meaning Property.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Coefficients type —
coefficient data type
Data type
Details
Specify the coefficient data type for this block.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Output —
type of filter output data
Inherit via internal rule | Same word length as input | Fixed-point
Details
If the input data is of a fixed-point type or an integer type, the block converts the output data of the filter using the rule or data type specified in this parameter. Quantization is performed using parameter settings Rounding mode. If the input data is of a floating-point type, the block ignores this parameter and returns the output data of the same type as the input.
The block increases the length of the word to achieve full accuracy within each filter and brings the final result to the specified type. The maximum finite internal data type ( ) depends on the type of input data ( ), the coefficient data type ( ) and the number of coefficients ( ) and is determined by the formula
When specifying a fixed set of coefficients, the actual internal length of a word with full precision is usually less than , because the coefficient values limit the potential growth.
When using programmable coefficients, the block cannot calculate the dynamic range, and the internal data type is always .
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Output type —
type of output data
Data type
Details
Specify the type of output data for this block.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |