Main Content

CIC Compensation Decimator

Compensate for CIC filter using FIR decimator

Library

Filtering/Filter Designs

dspfdesign

  • CIC Compensation Decimator block

Description

The CIC Compensation Decimator block uses an FIR polyphase decimator as the compensation filter. CIC compensation decimators are multirate FIR filters that can be cascaded with CIC decimators to mitigate the drawbacks of the CIC filters.

CIC decimation filters are used in areas that require high decimation. These filters are popular in ASICs and FPGAs, since they do not have any multipliers. CIC filters have two drawbacks:

  • CIC filters have a magnitude response that causes a droop in the passband region. This magnitude response is:

    a b s ( sin ( M ω 2 ) sin ( ω 2 ) ) n

    • M— Differential delay

    • n— Number of stages

    • ω— Normalized angular frequency

  • CIC filters have a wide transition region.

The compensation decimator filters have an inverse passband response to correct for the CIC droop, and they have a narrow transition width.

This block brings the capabilities of thedsp.CICCompensationDecimatorSystem object™ to the Simulink®environment.

Dialog Box

Main Tab

Rate change factor

Rate change factor for the CIC filter to be compensated, specified as a positive scalar integer. The default is2.

Number of sections

Number of decimator and comb sections of the CIC filter to be compensated, specified as a positive scalar integer. The default is2.

Differential delay

Delay value used in each of the comb sections of the CIC filter to be compensated, specified as a positive scalar integer. The default is1.

Decimation factor

大量毁灭因素的补偿器,指定为a positive scalar integer. The number of input rows must be a multiple of the decimation factor. The default is2.

Minimum order filter design

When you select this check box, the block designs filters with the minimum order that meets the specifications passband frequency, stopband frequency, passband ripple, and stopband attenuation. When you clear this check box, the block designs filters with the order that you specify inFilter order.

By default, this check box is selected.

Filter order

Order of compensation filter, specified as a positive scalar integer. The default is12.

Passband edge frequency (Hz)

Passband edge frequency of the compensation filter, specified as a real positive scalar in Hz.Passband edge frequency (Hz)must be less thanFs/2, whereFsis the input sample rate. The default value is100000.

Stopband edge frequency (Hz)

Stopband edge frequency of the compensation filter, specified as a real positive scalar in Hz.Stopband edge frequency (Hz)must be less thanFs/2, whereFsis the input sample rate. This parameter applies when you select theMinimum order filter designcheck box. The default is400000.

Passband ripple (dB)

Passband ripple of the compensation filter, specified as a real positive scalar in dB. The default is0.1.

Stopband attenuation (dB)

Stopband attenuation of the compensation filter, specified as a real positive scalar in dB. The default is60.

Inherit sample rate from input

When you select this check box, the block inherits its sample rate from the input signal. When you clear this check box, you must specify the sample rate inInput sample rate (Hz).

Input sample rate (Hz)

Input sample rate, specified as a scalar in Hz. The default is1200000.

View Filter Response

Opens the Filter Visualization Tool FVTool and displays the magnitude/phase response of theCIC Compensation Decimator. 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:

  • Code generation(default)

    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 simulation speed thanInterpreted execution.

  • Interpreted execution

    Simulate model using the MATLAB®interpreter. This option shortens startup time but has slower simulation speed thanCode generation.

Data Types Tab

Rounding mode

Rounding method for the output fixed-point operations. The rounding methods areCeiling,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 in such a way that the coefficients occupy maximum representable range without overflowing.

  • fixdt(1,16,0)— Signed fixed-point data type of word length16, fraction length0. You can change the fraction length to any other integer value.

  • — Specify the coefficients data type by using an expression that evaluates to a data type object, for example, numeric type (fixdt([ ],16,15)), to specify the coefficients data type. Specify the sign mode of this data type as[ ]or true.

  • 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.

See使用数据类型指定数据类型的助理(Simulink)for more information.

Supported Data Types

Port Supported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed or unsigned)

  • 8-, 16-, 32-, and 64-bit signed integers

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed only)

  • 8-, 16-, 32-, and 64-bit signed integers

Algorithms

The response of a CIC filter is given by:

H c i c ( ω ) = [ sin ( R D ω 2 ) sin ( ω 2 ) ] N

R,D, andNare the rate change factor, the differential delay, and the number of sections of the CIC filter, respectively.

After decimation, the cic response has the form:okay

H c i c ( ω ) = [ sin ( D ω 2 ) sin ( ω 2 R ) ] N

The normalized version of this last response is the one that the CIC compensator needs to compensate. Hence, the passband response of the CIC compensator should take the following form:

H c i c c o m p ( ω ) = [ R D sin ( ω 2 R ) sin ( D ω 2 ) ] N for ω ω p < π

whereωpis the passband frequency of the CIC compensation filter.

Notice that whenω/2R≪ π, the previous equation forHciccomp(ω) can be simplified using the fact that sin(x) ≅x:

H c i c c o m p ( ω ) [ ( D ω 2 ) sin ( D ω 2 ) ] N = [ s i n c ( D ω 2 ) ] N for ω ω p < π

This previous equation is the inverse sinc approximation to the true inverse passband response of the CIC filter.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced in R2015b