Filter Design Toolbox    
cicdecimate

Use a cascaded integrator-comb (CIC) decimation filter to decrease the sampling rate for a signal

Syntax

Description

y = cicdecimate(m,n,r,x,q) filters the data in input vector x, applying a decimation factor (or sample rate reduction) r to the signal. r must be a positive integer. For example, when r = 5, the decimation filter reduces the signal length to one-fifth of the original length.

Input arguments m and n define the number of integrator and comb stages (n) and the number of differential delays (m) in the CIC decimation filter. Although m can be any positive integer, most often it is 1 or 2. Each integrator stage in the CIC filter comprises a single-pole infinite impulse response (IIR) filter with a unity feedback coefficient.

q represents a quantizer operating in signed fixed-point mode, as specified by the fixed keyword argument to the function quantizer.

cicdecimate uses the int32 data type for all arithmetic operations it performs while decimating the input signal. Limiting the data type to int32 means when the most significant bit (MSB) at the filter output is greater than 32, the overall sum can overflow causing the result to be wrong. When the MSB exceeds 32, cicdecimate generates a warning message that the MSB is too large.

With reference to the high sampling rate, the transfer function for the composite CIC filter is

Design Considerations

When you design your CIC decimation filter, remember the following general points:

Examples

This example applies a decimation factor r equal to 8 to a 160-point impulse signal. The signal output from the filter has 160/r, or 20, points or samples. Choosing 10 bits for the quantizer wordlength represents a fairly common setting for analog to digital converters. The plot shown after the code presents the stem plot of the decimated signal, with 20 samples remaining after decimation:

This example demonstrates one way to compute the frequency response, using a 4-stage decimation filter with the decimation factor set to 7:

Here's the frequency response plot for the filter. For details about the transfer function used to produce the frequency response, refer to [1] in the References section.

Algorithm

To show how the CIC decimation filter is constructed, the following figure presents a block diagram of the filter structure for a two-stage CIC decimation filter (n = 2). fs is the high sampling rate, the input to the decimation process.

See Also

cicinterpolate, filterdesign

References

[1] Hogenauer, E. B., "An Economical Class of Digital Filters for Decimation and Interpolation," IEEE Transactions on Acoustics, Speech, and Signal Processing, ASSP-29(2): pp. 155-162, 1981

[2] Meyer-Baese, Uwe, "Hogenauer CIC Filters," in Digital Signal Processing with Field Programmable Gate Arrays, Springer, 2001, pp. 155-172


  cell2sos cicinterpolate