States from CIC filter


integerstates = int(hm.states)


integerstates = int(hm.states) returns the states of a CIC filter in matrix form, rather than as the native filtstates object. An important point about int is that it quantizes the state values to the smallest number of bits possible while maintaining the values accurately.


For many users, the states of multirate filters are most useful as a matrix, but the CIC filters store the states as objects. Here is how you get the states from you CIC filter as a matrix.

hm = mfilt.cicinterp;
hs = hm.states; % Returns a FILTSTATES.CIC object hs.
states = int(hs); % Convert object hs to a signed integer matrix.

After using int to convert the states object to a matrix, here is what you get.

Before converting:

ans =
    Integrator: [2x1 States]
          Comb: [2x1 States]

After the conversion and assigning the states to states:


states =

           0           0
           0           0

Introduced in R2011a

Was this topic helpful?