Differentiator Filter
Direct form FIR fullband differentiator filter
Library
Filtering / Filter Designs
dspfdesign
Description
TheDifferentiator Filterblock applies a fullband differentiator filter on the input signal to differentiate all its frequency components. The block uses an FIR equiripple filter design to design the differentiator filter. The ideal frequency response of the differentiator is for 。
You can design the filter with minimum order or with a specifies order.
The input signal can be a real- or complex-valued column vector or matrix. If the input signal is a matrix, each column of the matrix is treated as an independent channel.
This block supports variable-size input, enabling you to change the channel length during simulation. The output port properties, such as data type, complexity, and dimension, are identical to the input port properties. The block supports fixed-point operations.
This block also supports SIMD code generation. For details, seeCode Generation。
Examples
Dialog Box
Main Tab
- Design minimum order filter
-
When you select this check box, the block designs a filter with the minimum order, with the passband ripple specified inMaximum passband ripple (dB)。When you clear this check box, specify the order of the filter inFilter order。
By default, this check box is selected.
- Filter order
-
Filter order of the differentiator filter, specified as an odd positive scalar integer. You can specify the filter order only whenDesign minimum order filtercheck box is not selected. The default is
31
。 - Maximum passband ripple (dB)
-
Maximum ripple of the filter response in the passband, specified as a real positive scalar in dB. The default is
0.1
。 - Scale filter coefficients
-
When you select this check box, the filter coefficients are scaled to preserve the input dynamic range. By default, this check box is not selected.
- View Filter Response
-
Opens the Filter Visualization Tool (
fvtool
) and displays the magnitude and phase response of theDifferentiator Filterblock. The response is based on the block dialog box parameters. Changes made to these parameters update FVTool.To update the magnitude response while FVTool is running, modify the dialog box parameters and clickApply。
- Simulate using
-
Type of simulation to run. You can set this parameter to:
Interpreted execution
(default)Simulate model using the MATLAB®interpreter. This option shortens startup time and has faster simulation speed than
Code generation
。Code generation
Simulate model using generated C code. The first time you run a simulation, Simulink®generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster subsequent simulations.
Data Types Tab
- Rounding mode
-
Rounding method for the output fixed-point operations. The rounding methods are
Ceiling
,Convergent
,Floor
,Nearest
,Round
,Simplest
, andZero
。The default isFloor
。 - Coefficients
-
Fixed-point data type of the coefficients, specified as one of the following:
fixdt(1,16)
(default) — Signed fixed-point data type of word length16
, with binary point scaling. The block determines the fraction length automatically from the coefficient values such that the coefficients occupy the maximum representable range without overflowing.fixdt(1,16,0)
— Signed fixed-point data type of word length16
and fraction length0
。You can change the fraction length to any other integer value.— Specify the data type using an expression that evaluates to a data type object, for example, numeric type (
fixdt
([ ]
,16
,15
)). Specify the sign mode of this data type as[ ]
ortrue
。Refresh Data Type
— Refresh to the default data type.
Click theShow data type assistantbuttonto display the data type assistant, which helps you set the stage input parameter.
SeeSpecify Data Types Using Data Type Assistant(Simulink)for more information.
输出的字长是一样的词length of the input. The fraction length of the output is computed such that the entire dynamic range of the output can be represented without overflow. For details on how the block computes the fraction length, seeFixed-Point Precision Rules for Avoiding Overflow in FIR Filters。
Supported Data Types
Port | Supported Data Types |
---|---|
Input |
|
Output |
|