Store CIC filter states


filtstates.cic objects hold the states information for CIC filters. Once you create a CIC filter, the states for the filter are stored in filtstates.cic objects, and you can access them and change them as you would any property of the filter. This arrangement parallels that of the filtstates object that IIR direct-form I filters use (refer to filtstates for more information).

Each States property in the CIC filter comprises two properties — Numerator and Comb — that hold filtstates.cic objects. Within the filtstates.cic objects are the numerator-related and comb-related filter states. The states are column vectors, where each column represents the states for one section of the filter. For example, a CIC filter with four decimator sections and four interpolator sections has filtstates.cic objects that contain four columns of states each.


To show you thefiltstates.cic object, create a CIC decimator and filter a signal:

fs = 44.1e3;             % Original sampling frequency: 44.1kHz.
n = 0:10239;             % 10240 samples, 0.232 second long signal.
x  = sin(2*pi*1e3/fs*n); % Original signal, sinusoid at 1kHz.

hm has nonzero states now.

You can use int to see the states as 32-bit integers.

Was this topic helpful?