CIC decimation output is strange (Output word length and negative fractional length)
I’m implementing fixed point CIC decimation filter with following requirements —
Decimation factor: 20
Number of CIC stages: 4
Input and output bit width of the CIC: Signed 12-bit
Based on the above requirement, I created a CIC filter
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,…
NumSections=4,…
FixedPointDataType="Specify word lengths",…
SectionWordLengths=12,…
OutputWordLength=12);
As an input, 12-bit signed data generated as follow.
x = randi([-2048 2047], 100000, 1);
in = fi(x,1,12);
Now the singned 12-bit input data plug-in to the CIC decimation filter.
out = cicDecimOut(in)
However, checking the out shows the following at the end,
Two questions I have —
I was expecting signed 12-bit output as I set the OutputWordLength=12. However, out is much larger than 12-bit range. Why this happened. Not sure I was missing something. How could I fix this?
FractionLength is a negative value (-18). Can this be 0 as I wanted to see signed 12-bit? How could I compare this out with the values from the real RTL implementation?I’m implementing fixed point CIC decimation filter with following requirements —
Decimation factor: 20
Number of CIC stages: 4
Input and output bit width of the CIC: Signed 12-bit
Based on the above requirement, I created a CIC filter
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,…
NumSections=4,…
FixedPointDataType="Specify word lengths",…
SectionWordLengths=12,…
OutputWordLength=12);
As an input, 12-bit signed data generated as follow.
x = randi([-2048 2047], 100000, 1);
in = fi(x,1,12);
Now the singned 12-bit input data plug-in to the CIC decimation filter.
out = cicDecimOut(in)
However, checking the out shows the following at the end,
Two questions I have —
I was expecting signed 12-bit output as I set the OutputWordLength=12. However, out is much larger than 12-bit range. Why this happened. Not sure I was missing something. How could I fix this?
FractionLength is a negative value (-18). Can this be 0 as I wanted to see signed 12-bit? How could I compare this out with the values from the real RTL implementation? I’m implementing fixed point CIC decimation filter with following requirements —
Decimation factor: 20
Number of CIC stages: 4
Input and output bit width of the CIC: Signed 12-bit
Based on the above requirement, I created a CIC filter
cicDecimOut = dsp.CICDecimator(DecimationFactor=20,…
NumSections=4,…
FixedPointDataType="Specify word lengths",…
SectionWordLengths=12,…
OutputWordLength=12);
As an input, 12-bit signed data generated as follow.
x = randi([-2048 2047], 100000, 1);
in = fi(x,1,12);
Now the singned 12-bit input data plug-in to the CIC decimation filter.
out = cicDecimOut(in)
However, checking the out shows the following at the end,
Two questions I have —
I was expecting signed 12-bit output as I set the OutputWordLength=12. However, out is much larger than 12-bit range. Why this happened. Not sure I was missing something. How could I fix this?
FractionLength is a negative value (-18). Can this be 0 as I wanted to see signed 12-bit? How could I compare this out with the values from the real RTL implementation? cic, output word length, fractional word length, fixed-point MATLAB Answers — New Questions