The first CIC Decimator output is always zero

5 views (last 30 days)
Jay
Jay on 14 Dec 2023
Commented: Jay on 26 Jun 2024
It seems that the first CIC Decimator output is always zero and I don't understand its behavior.
I generated the input data and construct signed 12-bit data.
len_data = 100;
in = randi([-2048 2047], len_data, 1);
a = fi(in,1,12,0)
a =
314 -1721 1722 -925 30 -1070 2002 -265 -1356 1127 -1559 1843 1968 -1457 1010 274 1085 2039 -1424 -1938 1248 992 -205 -1640 -141 -321 -416 747 948 1956 -249 1306 1615 510 932 2009 422 -954 -1765 -1385 -194 -591 -525 -531 1038 1434 1840 411 724 269 614 849 -895 -303 1756 -1494 -1298 1522 -1478 -1051 1588 1048 1793 -124 -1771 -2006 -590 829 -1563 -107 329 -1741 677 -2003 643 898 -422 1626 -474 1419 448 1400 -1416 -717 866 1411 -441 -1070 622 -1803 -1481 -660 -1824 630 61 -1326 8 -57 1494 1528 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 12 FractionLength: 0
Then I created CIC filter object with decimation factor of 20, number of stages of 4, and internal bit width of 30-bit, and output bit width of 30-bit.
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,...
NumSections=4,...
FixedPointDataType="Specify word lengths",...
SectionWordLengths=30,...
OutputWordLength=30)
cicDecimOut =
dsp.CICDecimator with properties: DecimationFactor: 20 DifferentialDelay: 1 NumSections: 4 FixedPointDataType: 'Specify word lengths' SectionWordLengths: 30 OutputWordLength: 30
Then I checked the output of the CIC filter.
out = cicDecimOut(a)
out =
0 -372895 5999117 32856134 37682867 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 30 FractionLength: 0
My question is the first output of the CIC filter is always zero no matter the input is and I don't know why.

Answers (1)

Lokesh
Lokesh on 26 Jun 2024
Hi Jay,
I believe that the behavior you are observing where the first output of the CIC decimator is zero is expected due to the nature of how CIC filters operate.
A CIC filter consists of multiple integrator stages followed by comb stages. The integrators accumulate the input signal, and the comb stages perform differencing operations on the accumulated values. So as per my understanding, since there is no previous sample for the first input, the output is zero.
  1 Comment
Jay
Jay on 26 Jun 2024
Thanks for sharing the thought, Lokesh.
I also thought in that way. However, there are multiple stages of integrators and combs (e.g., 4 integrators and 4 combs in this example) with 0 being the initial values, then it takes more than one cycle all the initialization values are updated (e.g., input data take multiple cycles for propagation and update the initial status). Until then the CIC ouput is 0. In this case, there is only one zero output even though there are 8 stages of integrators and combs. Am I missed something?

Sign in to comment.

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!