Engee documentation

EngeeDSP.CICDecimator

Decimation of the signal using a cascade integrator-comb filter.

Library

EngeeDSP

Block

CIC Decimation

Description

System object EngeeDSP.CICDecimator performs a reduction in the sampling rate (decimation) of the input signal using a Cascaded comb Integrator (CIC) filter. The structure of the decimation CIC filter is a cascade of sections of integrators, followed by a change in speed by a factor of , and then a cascade of sections of comb filters. For more information, see Algorithms. Property NumSections sets the number of sections in the CIC filter. Property DecimationFactor sets the decimation coefficient .

To decimate the input signal, follow these steps:

  1. Create an object EngeeDSP.CICDecimator and set its properties.

  2. Call the object with arguments as if it were a function.

To learn more about how to work with system objects, see Engee System Objects.

Syntax

Creation

  • cicDecim = EngeeDSP.CICDecimator() returns a CIC decimation system object that applies a CIC decimation filter to the input signal.

  • cicDecim = EngeeDSP.CICDecimator(R,M,N) returns the CIC decimation system object, which has the DecimationFactor value set R, for the DifferentialDelay — value M, and for the property NumSections — the value N.

  • cicDecim = EngeeDSP.CICDecimator(___,Name=Value) returns a CIC decimation object cicDecim with the specified property Name, set to the specified value Value. You can specify additional arguments as a name-value pair in any order (Name1=Value1,…​,NameN=ValueN). Unspecified properties have default values.

    Example:

    # creating a CIC decimation system object with a decimation coefficient of 8
    cicDecim = EngeeDSP.CICDecimator(DecimationFactor = 8)

Using

  • cicDecimOut = cicDecim(input) reduces the sampling rate of the input signal using the CIC decimator.

Arguments

Input arguments

# input — input data

+ vector | the matrix

Details

Input data specified as a vector or matrix. The number of rows in the input data must be a multiple of the value of the DecimationFactor.

Data types

Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Fixed-point

Support for complex numbers

Yes

Output arguments

# cicDecimOut — output of the CIC + decimator vector | the matrix

Details

A decimated output signal returned as a vector or matrix. The size of the output frame is (1 / DecimationFactor) × input frame size. The complexity of the output data corresponds to the complexity of the input data.

If the input data has an embedded integer or fixed-point data type, the length of the output word and the length of the fraction depend on the fixed-point data type specified using the FixedPointDataType.

full accuracy

If for a property FixedPointDataType value set "Full precision", the following relation is applied:



where

  • — length of the output data word;

  • — the length of the fractional part of the output data;

  • — the length of the input data word;

  • — the length of the fractional part of the input data;

  • — the number of sections in the CIC filter, set by the property NumSections.

Values and they are inherited from the input data passed to the object’s algorithm. For embedded integer input data, the length of the fractional part is 0.

_ Setting the length of the word and the fractional part_

If for a property FixedPointDataType value set "Specify word and fraction lengths", then the length of the word and the length of the fractional part in the output will correspond to the values specified in the properties OutputWordLength and OutputFractionLength.

_ Setting the length of words_

If for a property FixedPointDataType value set "Specify word lengths", then the length of the output word will correspond to the value specified in the OutputWordLength. The length of the fractional part at the output It is defined as follows:

Data types

Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Fixed-point

Support for complex numbers

Yes

Features

# NumSections — number of integrator and comb filter sections
Int64 integer

Details

The number of integrator sections and the comb CIC filter, set as a positive integer. This number indicates the number of sections in the comb and integrator parts of the filter. The total number of sections in the CIC filter is twice the number of sections specified by this property.

# FixedPointDataType — the method of setting fixed-point properties
Symbol

Details

A method for setting fixed-point properties, specified by one of the following values:

  • "Full precision" — the length of the word and the length of the fractional part of the fixed-point numbers for the sections of the CIC filter and the output data of the object are processed with full accuracy.

  • "Specify word lengths" — specify the length of the word in the sections of the CIC filter and in the output data of the object using the properties SectionWordLengths and OutputWordLength. The object determines the appropriate lengths of the fractional parts to ensure the highest possible accuracy. For more information, see the description The argument cicDecimOut.

  • "Specify word and fraction lengths" — specify the length of the word and the length of the fractional parts in the sections of the CIC filter and in the output data of the object using the properties SectionWordLengths, SectionFractionLengths, OutputWordLength and OutputFractionLength.

# DecimationFactor — decimation coefficient
Int64 integer

Details

The coefficient by which the input signal is decimated, set as a positive integer.

# DifferentialDelay — differential delay of the comb signal sections
Int64 integer

Details

The differential delay value used in each of the comb filter sections is set as a positive integer. For more information, see Algorithms.

# SectionFractionLengths — the lengths of the fractional parts of fixed-point numbers for each filter section

Details

The lengths of the fractional parts of fixed-point numbers used for each filter section, specified as a scalar or vector of integers. The fraction length can be negative or equal to 0 or positive. If you specify a scalar, the value is applied to all sections of the filter. If you specify a vector, its length should be equal to 2 × NumSections.

Dependencies

To use this property, set the FixedPointDataType value "Specify word and fraction lengths".

# OutputWordLength — the length of the fixed-point word for the filter output
Int64 integer

Details

The length of the fixed-point word used for the filter output, set as an integer greater than or equal to 2.

Dependencies

To use this property, set the FixedPointDataType value "Specify word lengths" or "Specify word and fraction lengths".

# OutputFractionLength — the length of the fixed-point fraction for the filter output
Int64 integer

Details

The length of the fixed-point fraction used for the filter output is set as an integer.

Dependencies

To use this property, set the FixedPointDataType value "Specify word and fraction lengths".

# SectionWordLengths — the length of the fixed-point word for each filter section

Details

The length of the fixed-point word for each filter section, set as a scalar. The length of the word must be greater than or equal to 2. This value applies to all filter sections.

Dependencies

To use this property, set the FixedPointDataType value "Specify word lengths" or "Specify word and fraction lengths".

Methods

Common to all system objects

step!

Run the system object operation algorithm

release!

Allow changing the value of a system object property

reset!

Resetting the internal states of a system object

Additional Info

CIC filter

Details

CIC filters are an optimized class of linear phase FIR filters consisting of comb filters and integrators connected in series.

Conceptually, the decimation CIC filter is a single-frequency CIC filter , which is a low-pass filter to suppress distortion, followed by a sample rate reduction element. The CIC decimation filter reduces the sampling rate of the input signal by an integer factor using a Cascaded comb Integrator (CIC) filter.

cic decimator en

In a more efficient implementation, the CIC filter , which operates without changing the sampling rate, is decomposed into factors in this way:

where

  • — the transfer function of the cascade of integrators;

  • — transfer function sections of the cascade of comb filters, each of which has a width of ;

  • — the number of sections. The number of sections in a CIC filter is defined as the number of sections either in the comb part or in the integrating part of the filter. This value does not reflect the total number of sections in the entire filter.;

  • — the decimation coefficient;

  • — differential delay.

The algorithm that provides full multi-rate filtering takes into account two remarkable decimation identities that allow you to move the operation of changing the sampling frequency. for the cascade of comb filters without distorting the result of the operation. The transfer function of the resulting filter is given by the following equation:

For a flowchart showing a multi-speed implementation, see Algorithms.

Fixed-point signal

Details

The diagram of fixed-point signals shows the types of data that the object EngeeDSP.CICDecimator It is used for fixed-point signals.

cic decimator 1 en

Here

  • secNT = numerictype(1, secWL, secFL);

  • outNT = numerictype(1, outWL, outFL);

  • secWL — the length of the section word, set using the SectionWordLengths;

  • secFL — the length of the fractional part of the section, set using the SectionFractionLengths;

  • outWL — the length of the output word, set using the OutputWordLength;

  • outFL — the length of the fractional part of the output word, set using the OutputFractionLength.

The value of the NumSections property in this diagram is 2.

Algorithms

Decimation CIC filter

Details

The decimation CIC filter is implemented as a cascade of integrators, followed by an element of lowering the sampling rate of the signal in once, and then a cascade of comb filters.

cic decimator 2

The diagram shows a cascade of integrators with two sections and a cascade of comb filters, also consisting of two sections. The single delay in the CIC filter integrators can be located in both the forward and feedback circuits. These two configurations produce identical filter frequency characteristics. However, the actual numerical sequences in the output for these two configuration options will be different due to the effect of the delay. In this algorithm, a single delay is placed in the path of the direct line of the integrator, since this configuration is preferable for the HDL implementation.

Literature

  1. Hogenauer, E.B. «An Economical Class of Digital Filters for Decimation and Interpolation» IEEE Transactions on Acoustics, Speech and Signal Processing. Vol. 29, Number 2, 1981, pp. 155–162, 1981.

  2. Meyer-Baese, U. Digital Signal Processing with Field Programmable Gate Arrays. New York: Springer, 2001.

  3. Harris, Fredric J. Multirate Signal Processing for Communication Systems. Indianapolis, IN: Prentice Hall PTR, 2004.