Filter Design Toolbox    
mfilt.cicinterp

Construct a cascaded integrator-comb interpolation filter object

Syntax

Description

hm = mfilt.cicinterp(r,m,n,ibits,obits) constructs a cascaded integrator-comb (CIC) interpolation filter object.

The following table describes the input arguments for creating hm.

Input Arguments
Description
r
Interpolation 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).

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
InterpolationFactor
Any positive integer
None
Amount to increase the 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.
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 int32 matrix having size (m+1,n)
2-by-2 matrix, int32
Stored conditions for the filter, including values for the interpolator and comb states. The matrix dimension entries m and n are the differential delay and number of filter stages.

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 interpolation filter, remember the following general points:

Examples

Demonstrate interpolation by a factor of two, in this case from 22.05 KHz to 44.1 KHz. Note the scaling required to see the results in the stem plot and to use the full range of the int16 data type.

As you expect, the plot shows that the interpolated signal matches the input sine shape, with additional samples between each original sample.

Use the filter visualization tool (FVTool) to plot the response of the interpolator object. For example, to plot the response of an interpolator with an interpolation factor of 7, 4 stages, and 1 differential delay, do something like the following:

Algorithm

To show how the CIC interpolation 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 in the integrator section, refer to [1] in References.

See Also

cicdecimate, cicinterpolate, mfilt, mfilt.cicdecim, mfilt.cicdecimzerolat, mfilt.cicinterpzerolat

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


  mfilt.cicdecimzerolat mfilt.cicinterpzerolat 

Learn more about the latest releases of MathWorks products:

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