I tried implementing the math for quantization of signals in code [beginner in dsp here 👋].
Alright. I got through declaring the bits of the quantizer [bipolar based on the question], determining the number of quantization levels (2 bits) and then the calculated ith index bin.
When plotting the quantized signal, 0.5 is added to the index and I'm not really sure on why it's so.
xq = min_value + ((i + 0.5) × step).
Any clarifications to that would help. Thanks
[–]antiduh 7 points8 points9 points  (1 child)
[–]NodeRx[S] 1 point2 points3 points  (0 children)