How do you prevent quantization errors from stacking up when reducing a number's precision by a divide or bit-shift operation?
Anónimo
I did not know the answer outright because I haven't done much with DSP's or recursive filtering. But I was able to arrive at the answer pretty quickly. The basic idea is that you might split a 32bit word into 2x 16bit fields to do a sort of quasi-floating point math using purely unsigned integer data types. The high 16 bits represent the integer part of the number, and the low 16 bits represents the fractional part. When you're done doing your math on this quasi-FP number and you need to convert it back into a normal integer, you can just divide by 2^16, or bit shift right by 16 bits, but that introduces a quantization error by throwing away the fractional part. If the output bit-shifted number is used in a recursive filter, then how do you prevent your filter from accumulating the effect of always rounding down? I suggested that you should design the filter to alternate rounding down and rounding up on every other sample, so at least the intrinsic system bias is removed. This turned out to be correct, but it took 5-10 minutes to get there, and I got the feeling that the interviewer would have preferred that I just knew the answer. It ended up being a problem solving kind of question for something I think I was just supposed to know. Again, if DSP algorithms were important to this job, then why didn't it say so in the job description? But I could be wrong on this - it's just a feeling I got.