Currently, the CIC filters only work with the built-in signed integer data types such as INT8, INT16, and INT32.
The CIC filter must come first in the cascade. The following code shows how the code should be written:
L = 7;
N = 4;
hcic = mfilt.cicinterp(L,1,N);
dcGain = L*gain(hcic);
hscalar = dfilt.scalar(1/dcGain);
hscalar.Arithmetic = 'fixed';
Hcas = cascade(hcic,hscalar);
x = randn(1,64);
y = filter(Hcas,int16(x));
Please note that the CIC filter (hcic) must come first in the cascade. The reason is that output of the CIC filter is an INT16 in this case and the hscalar filter can interpret that data type. In Filter Design Toolbox 3.0 (R14) the CIC filters do not work with the output that is an embedded.fi object. In this example, the output of the hscalar filter is an embedded.fi object.
Best Answer