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

Minor issue on round vs. floor #93

Open
keithchugg opened this issue Jun 29, 2020 · 0 comments
Open

Minor issue on round vs. floor #93

keithchugg opened this issue Jun 29, 2020 · 0 comments

Comments

@keithchugg
Copy link

keithchugg commented Jun 29, 2020

In this line:

bin = numpy.floor((nfft+1)*mel2hz(melpoints)/samplerate)

I think you are assuming that np.floor(t+1) = np.round(t), but that is not true. I think your want:

bin = numpy.round((nfft)*mel2hz(melpoints)/samplerate)
bin = numpy.floor((nfft+0.5)*mel2hz(melpoints)/samplerate)

This is a minor point because they often give the same and it doesn't matter in practice. I just found this point a little confusing in your write-up.

Thanks for the blogpost and this code!

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