-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: implement resampling within xSampling to handle array lengths larger than the original size #200
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #200 +/- ##
==========================================
+ Coverage 91.69% 91.70% +0.01%
==========================================
Files 168 168
Lines 3286 3305 +19
Branches 824 824
==========================================
+ Hits 3013 3031 +18
- Misses 266 267 +1
Partials 7 7 ☔ View full report in Codecov by Sentry. |
@lpatiny I found a function (xSampling) in this package that performs down-sampling |
b163d63
to
94120b0
Compare
…ngths larger than original array size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like you add the following test case (and I'm not convinced about the current result). Not sure what you expect the algorithm to do.
xSampling([0], { length: 2 });
xSampling([1, 2], { length: 3 });
xSampling([1, 2], { length: 5 });
xSampling([1, 2, 3], { length: 5 });
xSampling([1, 2, 4], { length: 5 });
xSampling([1, 2, 4], { length: 7 });
xSampling([1, 2, 3], { length: 4 });
xSampling([1, 2, 4], { length: 4 });
xSampling([1, 2, 1], { length: 4 });
xSampling([1, 2, -1], { length: 5 });
Do you have a reference link to the current implementation because the results seems difficult to justify.
Defining the step size was where I made the mistake. result[i] = array[floor] * (1 - diff) + array[ceil] * diff; where let diff = currentIndex - floor; and ceil - floor = 1 |
No description provided.