Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should quantize be noninclusive of the upper bound? #101

Open
gitonthescene opened this issue May 13, 2024 · 0 comments
Open

Should quantize be noninclusive of the upper bound? #101

gitonthescene opened this issue May 13, 2024 · 0 comments

Comments

@gitonthescene
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant