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.

dsp.CICCompensationDecimator System object

Compensate for CIC decimation filter using FIR decimator

Description

You can compensate for the shortcomings of a CIC decimator, namely its passband droop and wide transition region, by following it with a compensation decimator. This System object™ lets you design and use such a filter. dsp.CICCompensationDecimator supports fixed-point operations and ARM Cortex code generation.

To compensate for the shortcomings of a CIC filter using an FIR decimator:

  1. Define and set up your CIC compensation decimator. See Construction.

  2. Call step to compensate for the passband droop and wide transition region of the CIC filter according to the properties of dsp.CICCompensationDecimator. The behavior of step is specific to each object in the toolbox.

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

ciccompdec = dsp.CICCompensationDecimator returns a System object, ciccompdec, that applies an FIR decimator to each channel of an input signal. Using the properties of the object, the decimation filter can be designed to compensate for a preceding CIC filter.

ciccompdec = dsp.CICCompensationDecimator(Name,Value) returns a CIC compensation decimator System object, ciccompdec, with properties and options specified by one or more Name,Value pair arguments.

ciccompdec = dsp.CICCompensationDecimator(decim,Name,Value) returns a CIC compensation decimator System object, ciccompdec, with the DecimationFactor property set to decim and additional properties and options specified by one or more Name,Value pair arguments.

ciccompdec = dsp.CICCompensationDecimator(cic,Name,Value) returns a CIC compensation decimator System object, ciccompdec, with the CICRateChangeFactor, CICNumSections, and CICDifferentialDelay properties specified in the dsp.CICDecimator System object cic and additional properties and options specified by one or more Name,Value pair arguments.

ciccompdec = dsp.CICCompensationDecimator(cic,decim,Name,Value) returns a CIC compensation decimator System object, ciccompdec, with the CICRateChangeFactor, CICNumSections, and CICDifferentialDelay properties specified in the dsp.CICDecimator System object cic, the DecimationFactor property set to decim, and additional properties and options specified by one or more Name,Value pair arguments.

Properties

expand all

Specify the differential delay of the CIC filter being compensated as a positive integer scalar. The default is 1.

Specify the number of sections of the CIC filter being compensated as a positive integer scalar. The default is 2.

Specify the rate-change factor of the CIC filter being compensated as a positive integer scalar. The default is 2.

Specify the decimation factor of the compensator System object as a positive integer scalar. The default is 2.

Specify whether to design a filter of minimum order or a filter of specified order as a logical scalar. The default is true, which corresponds to a filter of minimum order.

Specify the order of the decimation compensator filter as a positive integer scalar. This property applies only when you set the DesignForMinimumOrder property to false. The default is 12.

Specify the passband edge frequency as a positive real scalar expressed in hertz. PassbandFrequency must be less than Fs/2, where Fs is the input sample rate. The default is 100 kHz.

Specify the filter passband ripple as a positive real scalar expressed in decibels. The default is 0.1 dB.

Specify the input sample rate as a positive real scalar expressed in hertz. The default is 1200 kHz.

Specify the filter stopband attenuation as a positive real scalar expressed in decibels. The default is 60 dB

Specify the stopband edge frequency as a positive real scalar expressed in hertz. StopbandFrequency must be less than Fs/2, where Fs is the input sample rate. The default is 400 kHz.

Fixed-Point Properties

Word and fraction lengths of coefficients, specified as a signed or unsigned numerictype object. The default, numerictype(1,16) corresponds to a signed numeric type object with 16-bit coefficients and a fraction length determined based on the coefficient values, to give the best possible precision.

This property is not tunable.

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

Rounding method for output fixed-point operations, specified as a character vector. For more information on the rounding modes, see Precision and Range.

Methods

resetReset internal states of CIC compensation decimator
stepCompensate for preceding CIC filter

More Analysis Methods for Filter System Objects.

You can also type dsp.CICCompensationDecimator.helpFilterAnalysis at the command line to obtain a list of multirate discrete-time filter analysis methods supported for dsp.CICCompensationDecimator objects.

Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

expand all

Design an CIC compensation decimator. Specify the decimation factor to be 2, passband frequency to be 4 kHz, stopband frequency to be 4.5 kHz, and the input sample rate to be 16 kHz.

fs = 16e3;
fPass = 4e3;
fStop = 4.5e3;

CICCompDecim = dsp.CICCompensationDecimator('DecimationFactor',2,'PassbandFrequency',fPass, ...
    'StopbandFrequency',fStop,'SampleRate',fs);

Plot the impulse response. The group delay of the filter is 45.5.

fvtool(CICCompDecim,'Analysis','impulse')

Plot the magnitude and Phase response.

fvtool(CICCompDecim,'Analysis','freq')

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Design a compensation decimator for an existing CIC decimator having six sections and a decimation factor of 6.

CICDecim = dsp.CICDecimator('DecimationFactor',6, ...
    'NumSections',6);

Construct the compensation decimator. Specify a decimation factor of 2, an input sample rate of 16 kHz, a passband frequency of 4 kHz, and a stopband frequency of 4.5 kHz.

fs = 16e3;
fPass = 4e3;
fStop = 4.5e3;

CICCompDecim = dsp.CICCompensationDecimator(CICDecim, ...
    'DecimationFactor',2,'PassbandFrequency',fPass, ...
    'StopbandFrequency',fStop,'SampleRate',fs);

Visualize the frequency response of the cascade. Normalize all magnitude responses to 0 dB.

filtCasc = dsp.FilterCascade(CICDecim,CICCompDecim);

f = fvtool(CICDecim, CICCompDecim, filtCasc, ...
    'Fs', [fs*6 fs fs*6]);

f.NormalizeMagnitudeto1 = 'on';
legend(f,'CIC Decimator','CIC Compensation Decimator', ...
    'Overall Response');

Apply the design to a 1200-sample random input signal.

x = dsp.SignalSource(fi(rand(1200,1),1,16,15),'SamplesPerFrame',120);

y = fi(zeros(0,1),1,32,20);
for ind = 1:10
    x2 = CICDecim(x());
    y = [y;CICCompDecim(x2)];
end

Extended Capabilities

Introduced in R2014b

Was this topic helpful?