Maybe there's a subtlety I'm missing, but should quantize normalize when the max(ys) >= 1? Or maybe it's more about quantize handling the upper bound.
>>> quantize(np.array([-1,0,1]), bound, np.int16)
array([-32768, 0, -32768], dtype=int16)
>>>
I was trying to follow along with the code in another programming language and was getting clicks which I tracked down to this. When eyeballing the code to try to see how thinkdsp.py handled it I spotted this.
Probably not the biggest deal or maybe I missed something but thought I'd pass it on in any event.
Regards