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

Downsampler issue #288

Closed
jisung opened this issue Dec 8, 2014 · 0 comments
Closed

Downsampler issue #288

jisung opened this issue Dec 8, 2014 · 0 comments
Labels

Comments

@jisung
Copy link
Contributor

jisung commented Dec 8, 2014

getRoundedSampleSize() method in Downsampler decreases the sample size which is an exact power of 2 returned from getSampleSize(). This is caused by using Integer.highestOneBit(exactSampleSize - 1) instead of Integer.highestOneBit(exactSampleSize). Here is some outputs for your understanding,

Current Impl.:
getSampleSize():1-> getRoundedSampleSize():1
getSampleSize():2-> getRoundedSampleSize():1
getSampleSize():3-> getRoundedSampleSize():2
getSampleSize():4-> getRoundedSampleSize():2
getSampleSize():5-> getRoundedSampleSize():4
getSampleSize():6-> getRoundedSampleSize():4
getSampleSize():7-> getRoundedSampleSize():4
getSampleSize():8-> getRoundedSampleSize():4
getSampleSize():9-> getRoundedSampleSize():8

Expected results:
getSampleSize():1-> getRoundedSampleSize():1
getSampleSize():2-> getRoundedSampleSize():2
getSampleSize():3-> getRoundedSampleSize():2
getSampleSize():4-> getRoundedSampleSize():2
getSampleSize():5-> getRoundedSampleSize():4
getSampleSize():6-> getRoundedSampleSize():4
getSampleSize():7-> getRoundedSampleSize():4
getSampleSize():8-> getRoundedSampleSize():8
getSampleSize():9-> getRoundedSampleSize():8

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

No branches or pull requests

2 participants