Filter Design Toolbox    
mfilt.cicdecimzerolat

Construct a cascaded integrator-comb decimation filter object that does not exhibit latency

Syntax

Description

hm = mfilt.cicdecimzerolat(r,m,n,ibits,obits,bps) returns a zero-latency cascaded integrator-comb (CIC) decimation filter object. mfilt.cicdecimzerolat best matches the function cicdecimate.

The following table describes the input arguments for creating hm.

Input Arguments
Description
r
Decimation factor applied. Sharpens the response curve to let you change the shape of the response.
m
Differential delay. Changes both the shape and number of nulls in the filter response. Also affects the null locations. Increasing m increases the number and sharpness of the nulls and response between nulls. Generally, one or two work as values for m.
n
Number of stages. Deepens the nulls in the response curve.
ibits
Word length of the input signal. It can be either 8, 16, or 32 bits (default is 16).
obits
Word length of the output signal. It can be any positive integer in the range of 1 to 32 (default is 16).
bps
Defines the bits per stage used while accumulating the data in the integrator stages or while subtracting the data during the comb stages (using 'wrap' arithmetic). Enter bps as a scalar or vector of length 2*n, where n is the number of stages. When bps is a scalar, the scalar value is applied to each filter stage. The default is 16 for each stage in the decimator.

Objects have properties that control the way the object behaves. This table lists all the properties for the filter, with a description of each.

Name
Values
Default
Description
BitsPerStage
Any integer or a vector of length 2*n
16
Defines the bits per stage used while accumulating the data in the integrator stages or while subtracting the data during the comb stages (using 'wrap' arithmetic). Enter bps as a scalar or vector of length 2*n, where n is the number of stages. When bps is a scalar, the scalar value is applied to each filter stage. The default is 16 for each stage in the decimator.
DecimationFactor
Any positive integer
2
Amount to reduce the input sampling rate.
DifferentialDelay
Any integer
1
Sets the differential delay for the filter. Usually a value of one or two is appropriate.
FilterStructure
Any mfilt structure string
None
Reports the type of filter object, such as a decimator or fractional integrator. You cannot set this property--it is always read only and results from your choice of mfilt object.
InputBitWidth
8, 16, 32
16
Word length of the input samples.
NonProcessedSamples
Any
0
Shows the values of the samples that were not processed during the filtering operation. Note that this is not the number of samples that were not processed.
NumOfSamplesProcessed
Any integer
0
Returns the number of samples processed during filtering. As a check, the number of samples reported processed plus the number of nonprocessed samples should be the total number of input samples.
NumberOfStages
Any positive integer
2
Number of stages used in the decimator.
OutputBitWidth
1 to 32
16
Word length of the output samples.
ResetBeforeFiltering
'off' or 'on'

on
Determine whether the filter states get restored to their starting values for each filtering operation. The starting values are the values in place when you create the filter if you have not changed the filter since you constructed it. ResetBeforeFiltering returns to zero any state that the filter changes during processing. States that the filter does not change are not affected.
States
Any m+1-by-n matrix of int32 values
2-by-2 matrix, int32
Stored conditions for the filter, including values for the integrator and comb sections. n is the number of filter stages and m is the differential delay.

About the States of the Filter

In the states property you find the states for both the integrator and comb portions of the filter. states is a matrix of dimensions m+1-by-n, with the states apportioned as follows:

In the state matrix, state values are specified and stored in int32 format.

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 word length 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:

Using FVTool you can change the annotations to match the figure shown here. 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.

For details about the bits that are removed after each stage, refer to [1] in References.

See Also

mfilt, mfilt.cicdecimzerolat, mfilt.cicinterp, mfilt.cicinterpzerolat, cicdecimate

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, pp. 155-172, Springer, 2001


  mfilt.cicdecim mfilt.cicinterp 

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS