I have found this piece of code in Infenion DSP Library (asm code):
Fir_Blk_16()
...
;(ACC)=(ACC)+h(i)*x(n-i)<<1 as comment
I don't understand why the result is shifted (<<1)?
Is this for rounding purposes?
Thank you in advance,
Anton
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.
Sign up to join this communityI have found this piece of code in Infenion DSP Library (asm code):
Fir_Blk_16()
...
;(ACC)=(ACC)+h(i)*x(n-i)<<1 as comment
I don't understand why the result is shifted (<<1)?
Is this for rounding purposes?
Thank you in advance,
Anton
The shifting is most likely related to the fixed point representation. If input, filter coefficients and accumulator are in different "Qs" (which is the fixed to float scale factor), shifts are used to adjust.
See for example: https://en.wikipedia.org/wiki/Q_(number_format)