dsp.CICDecimator

Description

The dsp.CICDecimator
System
object™ decimates an input signal using a cascaded integrator-comb (CIC) decimation
filter. The CIC decimation filter structure consists of N sections of
cascaded integrators, followed by a rate change by a factor of R, followed
by N sections of cascaded comb filters. For details, see Algorithms. The NumSections property specifies N, the number of sections in
the CIC filter. The DecimationFactor property
specifies R, the decimation factor. The getFixedPointInfo
function returns the word lengths and fraction lengths of the fixed-point sections and the
output for the dsp.CICDecimator
System
object. You can also generate HDL code for this System
object using the generatehdl
function.

Description

cicDecim = dsp.CICDecimator(R,M,N)
creates a CIC decimation object with the DecimationFactor property
set to R, the DifferentialDelay property set to
M, and the NumSections property set to
N.

cicDecim = dsp.CICDecimator(Name,Value)
creates a CIC decimation object with each specified property set to the specified value.
Enclose each property name in single quotes. You can use this syntax with any previous
input argument combination.

Differential delay value used in each of the comb sections of the filter, specified
as a positive integer. For details, see Algorithms. If the differential
delay is a built-in integer data type, the decimation factor must be the same integer
data type or double. For example, if the differential delay is an
int8, then the decimation factor must be an int8
or double.

Number of integrator and comb sections of the CIC filter, specified as a positive
integer. This number indicates the number of sections in either the comb part or the
integrator part of the filter. The total number of sections in the CIC filter is twice
the number of sections given by this property.

Full precision – The word length and fraction length of the
CIC filter sections and the object output operate in full precision.

Minimum section word lengths – Specify the output word length
through the OutputWordLength
property. The object determines the filter section data type and the output fraction
length that give the best possible precision. For details, see getFixedPointInfo and cicDecimOut argument.

Specify word lengths – Specify the word lengths of the CIC
filter sections and the object output through the SectionWordLengths
and OutputWordLength
properties. The object determines the corresponding fraction lengths to give the
best possible precision. For details, see getFixedPointInfo and the cicDecimOut argument.

Fixed-point word lengths to use for each filter section, specified as a scalar or a
row vector of integers. The word length must be greater than or equal to 2. If you
specify a scalar, the value applies to all the sections of the filter. If you specify a
vector, the vector must be of length 2 × NumSections.

Example: 32

Example: [32 32 32 32]

Dependencies

This property applies when you set the FixedPointDataType
property to 'Specify word lengths' or 'Specify word and
fraction lengths'.

Fixed-point fraction lengths to use for each filter section, specified as a scalar
or a row vector of integers. The fraction length can be negative, 0, or positive. If you
specify a scalar, the value applies to all the sections of the filter. If you specify a
vector, the vector must be of length 2 × NumSections.

Example: -2

Example: [-2 0 5 8]

Dependencies

This property applies when you set the FixedPointDataType
property to 'Specify word and fraction lengths'.

Usage

Syntax

Description

Input Arguments

input — Data inputvector | matrix

Data input, specified as a vector or matrix. The number of rows in the input must
be a multiple of the DecimationFactor. If the input is of
single or double data type, property settings
related to the fixed-point data types are ignored.

Output Arguments

cicDecimOut — CIC decimator outputvector | matrix

Decimated output, returned as a vector or a matrix. The output frame size equals
(1 ∕ DecimationFactor) × input frame size. The complexity of the
output data matches that of the input data. If the input is single
or double, the output data type matches the input data type.

If the input is of built-in integer data type or of fixed-point data type, the
output word length and fraction length depend on the fixed-point data type setting you
choose through the FixedPointDataType property.

Full precision

When the FixedPointDataType is set to 'Full
precision', the following relationship applies:

WLoutput=WLinput+NumSectFLoutput=FLinput

where,

WLoutput –– Word length of the
output data.

FLoutput –– Fraction length of the
output data.

WLinput –– Word length of the
input data.

FLinput –– Fraction length of the
input data.

NumSect –– Number of sections in the CIC filter specified
through the NumSections property.

The WLinput and
FLinput are inherited from the data input
you pass to the object algorithm. For built-in integer inputs, the fraction length is
0.

Minimum section word lengths

When the FixedPointDataType property is set to
'Minimum section word lengths', the output word length is the
value you specify in the OutputWordLength property. The output fraction
length, FLoutput, is given by:

FLoutput=WLoutput−(WLinput−FLinput+NumSect)

Specify word and fraction lengths

When the FixedPointDataType property is set to
'Specify word and fraction lengths', the output word length and
fraction length are the values you specify in the OutputWordLength and OutputFractionLength properties.

Specify word lengths

When the FixedPointDataType property is set to
'Specify word lengths', the output word length is the value you
specify in the OutputWordLength property. The output fraction
length, FLoutput, is given by:

Common to All System Objects

For a list of filter analysis methods this object supports, type
dsp.CICDecimator.helpFilterAnalysis in the MATLAB® command prompt. For the corresponding function reference pages, see Analysis Methods for Filter System Objects.

Determine the Section and Output Word Lengths and Fraction Lengths

Using the getFixedPointInfo function, you can determine the word lengths and fraction lengths of the fixed-point sections and the output of the dsp.CICDecimator and dsp.CICInterpolator System objects. The data types of the filter sections and the output depend on the FixedPointDataType property of the filter System object™.

Full precision

Create a dsp.CICDecimator object. The default value of the NumSections property is 2. This value indicates that there are two integrator and comb sections. The WLs and FLs vectors returned by the getFixedPointInfo function contain five elements each. The first two elements represent the two integrator sections. The third and fourth elements represent the two comb sections. The last element represents the filter output.

By default, the FixedPointDataType property of the object is set to 'Full precision'. Calling the getFixedPointInfo function on this object with the input numeric type, nt, yields the following word length and fraction length vectors.

The output and section word lengths are the sum of input word length, 64 in this case, and the number of sections, 2. The output and section fraction lengths are 0 since the input is a built-in integer.

Minimum section word lengths

Release the object and change the FixedPointDataType property to 'Minimum section word lengths'. Determine the section and output fixed-point information when the input is fixed-point data, fi(randn(8,2),1,24,15).

The section and output word lengths and fraction lengths are assigned as per the respective fixed-point properties of the cicD object. These values are not determined by the input numeric type. To confirm, call the getFixedPointInfo function without passing the numerictype input argument.

[WLs, FLs] = getFixedPointInfo(cicD) %#ok

WLs = 1×5
16 16 16 16 32

FLs = 1×5
0 0 0 0 0

Specify word lengths

To specify the word lengths of the filter section and output, set the FixedPointDataType property to 'Specify word lengths'.

N is the number of sections. The number of sections in a CIC
filter is defined as the number of sections in either the comb part
or the integrator part of the filter. This value does not
represent the total number of sections throughout the entire filter.

R is the decimation factor.

M is the differential delay.

For the multirate implementation, the algorithm applies the noble identity for
decimation and moves the rate change factor, R, to follow after the
N sections of the cascaded integrators. The transfer function of the
resulting filter is given by the following equation:

H(z)=(1−z−M)N(1−z−1)N.

For a block diagram that shows the multirate implementation, see Algorithms.

Algorithms

CIC Decimation Filter

The filter H(z) in More About is realized as a decimation
filter when the N sections of the cascaded integrators are followed by a
rate change factor of R, followed by N sections of
comb filters.

This diagram shows two sections of cascaded integrators and two sections of cascaded
comb filters. The unit delay in the integrator portion of the CIC filter can be located in
either the feedforward or the feedback path. These two configurations yield identical filter
frequency response. However, the numerical outputs from these two configurations are
different due to the latency. This block puts the unit delay in the feedforward path of the
integrator because it is a preferred configuration for HDL implementation.

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.