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.CICCompensationInterpolator System object

Compensate for CIC interpolation filter using FIR interpolator

Description

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

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

  1. Define and set up your CIC compensation interpolator. 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.CICCompensationInterpolator. 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

ciccompint = dsp.CICCompensationInterpolator returns a System object, ciccompint, that applies an FIR interpolator to each channel of an input signal. Using the properties of the object, the interpolation filter can be designed to compensate for a subsequent CIC filter.

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

ciccompint = dsp.CICCompensationInterpolator(interp,Name,Value) returns a CIC compensation interpolator System object, ciccompint, with the InterpolationFactor property set to interp and additional properties and options specified by one or more Name,Value pair arguments.

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

ciccompint = dsp.CICCompensationInterpolator(cic,interp,Name,Value) returns a CIC compensation interpolator System object, ciccompint, with the CICRateChangeFactor, CICNumSections, and CICDifferentialDelay properties specified in the dsp.CICInterpolator System object cic, the InterpolationFactor property set to interp, 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 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 interpolation 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 interpolation factor of the compensator System object as a positive integer scalar. The default is 2.

Specify the passband edge frequency as a positive real scalar expressed in hertz. PassbandFrequency must be less than Fs/2, where Fs is the output 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 600 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 output 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 interpolator
stepCompensate for subsequent CIC filter

More Analysis Methods for Filter System Objects.

You can also type dsp.CICCompensationInterpolator.helpFilterAnalysis at the command line to obtain a list of multirate discrete-time filter analysis methods supported for dsp.CICCompensationInterpolator 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 interpolator. Specify the interpolation factor to be 2, passband frequency to be 200 Hz, stopband frequency to be 500 Hz, and the input sample rate to be 600 Hz.

fs = 600;
fPass = 200;
fStop = 500;

CICCompInterp = dsp.CICCompensationInterpolator('InterpolationFactor',2,'PassbandFrequency',fPass, ...
    'StopbandFrequency',fStop,'SampleRate',fs);

Plot the impulse response. The zeroth order coefficient is delayed 6 samples, which is equal to the group delay of the filter.

fvtool(CICCompInterp,'Analysis','impulse')

Plot the magnitude and Phase response.

fvtool(CICCompInterp,'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 interpolator for an existing CIC interpolator having six sections and an interpolation factor of 16.

CICInterp = dsp.CICInterpolator('InterpolationFactor',16, ...
    'NumSections',6);

Construct the compensation interpolator. Specify an interpolation factor of 2, an input sample rate of 600 Hz, a passband frequency of 100 Hz, and a stopband frequency of 250 Hz. Set the minimum attenuation of alias components in the stopband to be at least 80 dB.

fs = 600;
fPass = 100;
fStop = 250;
ast = 80;

CICCompInterp = dsp.CICCompensationInterpolator(CICInterp, ...
    'InterpolationFactor',2,'PassbandFrequency',fPass, ...
    'StopbandFrequency',fStop,'StopbandAttenuation',ast, ...
    'SampleRate',fs);

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

FC = dsp.FilterCascade(CICCompInterp, CICInterp);

f = fvtool(CICCompInterp,CICInterp,FC, ...
    'Fs', [fs*2 fs*16*2 fs*16*2]);

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

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

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

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

Extended Capabilities

Introduced in R2014b

Was this topic helpful?