CIC Decimation HDL Optimized

Decimate signal using cascaded integrator-comb filter optimized for HDL code generation

  • Library:
  • DSP System Toolbox HDL Support / Filtering

  • CIC Decimation HDL Optimized block

Description

The CIC Decimation HDL Optimized block decimates an input signal by using a cascaded integrator-comb (CIC) decimation filter. CIC decimation filters are a class of linear phase FIR filters consisting of a comb part and an integrator part. The CIC decimation filter structure consists of N sections of cascaded integrators, a rate change factor of R, and N sections of cascaded comb filters. For more information about CIC decimation filters, see Algorithms.

The block supports scalar and vector inputs. For both types of inputs, the block provides a scalar output. The block supports fixed and variable decimation for scalar inputs and only fixed decimation for vector inputs.

The block provides an architecture suitable for HDL code generation and hardware deployment.

Ports

Input

expand all

Specify input data as a scalar or a column vector of length 1 to 64. The input data must be a signed integer or signed fixed point with a word length less than or equal to 32. Decimation factor (R) parameter must be an integer multiple of the input frame size.

Data Types: int8 | int16 | int32 | fixed point
Complex Number Support: Yes

This port is a control signal that indicates if the input data is valid. When this value is 1, the block captures the values from the data input port. When this value is 0, the block ignores the values from the data input port.

Data Types: Boolean

Use this port to dynamically specify the variable decimation rate during run time.

This value must be of data type ufix12 and an integer in the range from 2 to the Decimation factor (R) parameter value.

Dependencies

To enable this port, select the Variable decimation parameter.

Data Types: fixdt(0,12,0)

When this value is 1, the block stops the current calculation and clears all internal states. When this value is 0 and the input valid port is 1, the block starts a new filtering operation.

Dependencies

To enable this port, select the Enable reset input port parameter.

Data Types: Boolean

Output

expand all

You can define the data type of this output by setting the Output data type parameter.

Data Types: int8 | int16 | int32 | fixed point
Complex Number Support: Yes

This port is a control signal that indicates if the data from the data output port is valid. When this value is 1, the block returns valid data on the data output port. When this value is 0, the values on the data output port are not valid.

Data Types: Boolean

Parameters

expand all

  • Select this parameter to operate the block with a variable decimation rate specified from the decimFactor input port.

  • Clear this parameter to operate the block with a fixed decimation rate specified from the Decimation factor (R) parameter.

Note

For vector inputs, the block does not support variable decimation.

Specify the decimation factor rate with which you want to decimate the input.

When you select the Variable decimation parameter, the Decimation factor (R) parameter sets the upper bound of the range of valid values for the decimFactor input port.

Specify the differential delay of the comb part of the block.

Specify the number of sections in either the comb part or the integrator part of the block.

Select the data type for the output data.

  • Full precision — The output data type has a word length equal to the input word length plus gain bits.

  • Same word length as input — The output data type has a word length equal to the input word length.

  • Minimum section word lengths — The output data type uses the word length you specify in the Output word length parameter. When you select this option, the block applies the Pruning algorithm. For more information about the Pruning algorithm, see [1]. This option is not supported when you select the Variable decimation parameter.

Specify the word length of the output.

Note

When this value is 2, 3, 4, 5, or 6, the block might overflow the output data.

Dependencies

To enable this parameter, set the Output data type parameter to Minimum section word lengths.

Select this parameter to compensate for the output gain of the block.

Depending on the type of input, the decimation you specify, and the value of this parameter, the latency of the block changes. Here, N means the number of sections and vecLen means the length of the vector.

For a scalar input with fixed decimation (the Variable decimation parameter is cleared):

  • When you clear this parameter, the latency of the block is 3 + N clock cycles.

  • When you select this parameter, the latency of the block is 3 + N + 9 clock cycles.

For a scalar input with variable decimation (the Variable decimation parameter is selected):

  • When you clear this parameter, the latency of the block is 4 + N clock cycles.

  • When you select this parameter, the latency of the block is 4 + N + 9 clock cycles.

For a vector input with fixed decimation (the Variable decimation parameter is cleared):

  • When you clear this parameter, the latency of the block is floor((vecLen – 1) * (N/vecLen)) + 1 + N + (2 + (vecLen + 1) * N clock cycles.

  • When you select this parameter, the latency of the block is floor((vecLen – 1) * (N/vecLen)) + 1 + N + (2 + (vecLen + 1) * N) + 9 clock cycles.

Note

For vector inputs, the block does not support variable decimation.

Select this parameter to enable the reset input port.

Algorithms

expand all

References

[1] Hogenauer, E. “An Economical Class of Digital Filters for Decimation and Interpolation.” IEEE Transactions on Acoustics, Speech, and Signal Processing 29, no. 2 (April 1981): 155–62. https://doi.org/10.1109/TASSP.1981.1163535.

Extended Capabilities

Introduced in R2019b