Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Differentiator Filter

Direct form FIR fullband differentiator filter

Library

Filtering / Filter Designs

dspfdesign

Description

The Differentiator Filter block 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 D(ω)=jω 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.

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 in Maximum passband ripple (dB). When you clear this check box, specify the order of the filter in Filter 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 when Design minimum order filter check 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 the Differentiator Filter block. 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 click Apply.

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, and Zero. The default is Floor.

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 length 16, 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 length 16 and fraction length 0. You can change the fraction length to any other integer value.

  • <data type expression> — 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 [ ] or true.

  • Refresh Data Type — Refresh to the default data type.

Click the Show data type assistant button to display the data type assistant, which helps you set the stage input parameter.

See Specify Data Types Using Data Type Assistant for more information.

The word length of the output is same as the word 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, see Fixed-Point Precision Rules for Avoiding Overflow in FIR Filters.

Algorithms

Differentiator Filter

Differentiator computes the derivative of a signal. The frequency response of an ideal differentiator filter is given by D(ω)=jω, defined over the Nyquist interval πωπ.

The frequency response is antisymmetric and is linearly proportional to the frequency.

dsp.Differentiator object acts as a differentiator filter. This object condenses the two-step process into one. For the minimum order design, the object uses generalized Remez FIR filter design algorithm. For the specified order design, the object uses the Parks-McClellan optimal equiripple FIR filter design algorithm. The filter is designed as a linear phase Type-IV FIR filter with a Direct form structure.

The ideal differentiator has an antisymmetric impulse response given by d(n)=d(n). Hence d(0)=0. The differentiator must have zero response at zero frequency.

Linear-Phase FIR Differentiator Filter

The impulse response of an antisymmetric linear-phase FIR filter is given by h(n)=h(M1n), where M is the length of the filter. Because the filter is antisymmetric, you can use this type of FIR filter to design the linear-phase FIR differentiators.

Consider the design of linear-phase FIR differentiators based on the Chebyshev approximation criterion.

If M is odd, the real-valued frequency response of the FIR filter, Hr(ω), has the characteristics that Hr(0) = 0 and Hr(π) = 0. This filter satisfies the condition of zero response at zero frequency. However, it is not fullband because Hr(π) = 0. This differentiator has a linear response over the limited frequency range [0 2πfp], where fp is the bandwidth of the differentiator. The absolute error between the desired response and the Chebyshev approximation increases as ω increases from 0 to 2πfp.

If M is even, the real-valued frequency response of the FIR filter, Hr(ω), has the characteristics that Hr(0) = 0 and Hr(π) ≠ 0. This filter satisfies the condition of zero response at zero frequency. It is fullband and this design results in a significantly smaller approximation error than comparable odd-length differentiators. Hence, even-length (odd order) differentiators are preferred in practical systems.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed or unsigned)

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed or unsigned)

Introduced in R2015b

Was this topic helpful?