-
Notifications
You must be signed in to change notification settings - Fork 112
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
Fix bounds errors when resampling with some arbitrary ratios #539
Fix bounds errors when resampling with some arbitrary ratios #539
Conversation
7f85d33
to
268f3be
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #539 +/- ##
=======================================
Coverage 97.56% 97.56%
=======================================
Files 18 18
Lines 3125 3127 +2
=======================================
+ Hits 3049 3051 +2
Misses 76 76 ☔ View full report in Codecov by Sentry. |
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.
This is an ugly hack, but the situation is certainly better than before...
In some cases when `filt(::FIRFilter{FIRArbitrary}, x)` is called with certain values of `x`, `filt!(buffer, ::FIRFilter{FIRArbitrary}, x)` tries to write one sample too many to the buffer and a `BoundsError` is thrown. Add one extra sample to the buffer to catch these exceptional cases. (This code is really a hack and simply works around the deeper problem of calculating the correct output buffer length; this should instead be addressed properly in a future change.) Closes JuliaDSP#317.
268f3be
to
b790b4e
Compare
The following isn't quite correct:
The output buffer is the correct length; it is the writing to the buffer in the |
@anowacki Would it be helpful for you to have commit access with the repo to help with maintenance? Not a whole lot changes workflow wise (PRs, reviews, etc), but we have more hands to keep things going and to improve the package. |
@ViralBShah I'm not averse to the idea, but I'm really only making PRs for things that I have already sorted out locally to get work done. I would also not consider myself as much of an expert on signal processing as I would like to be to help maintain the repo. |
Thanks. Happy to add you later if it makes sense. Just let me know. |
Merge? |
I ran into this issue and found that it is fixed on the main branch. @martinholters would it be possible to trigger a release including this fix? |
In some cases when `filt(::FIRFilter{FIRArbitrary}, x)` is called with certain values of `x`, `filt!(buffer, ::FIRFilter{FIRArbitrary}, x)` tries to write one sample too many to the buffer and a `BoundsError` is thrown. Add one extra sample to the buffer to catch these exceptional cases. (This code is really a hack and simply works around the deeper problem of calculating the correct output buffer length; this should instead be addressed properly in a future change.) Closes #317. (cherry picked from commit 73d3214)
In some cases when `filt(::FIRFilter{FIRArbitrary}, x)` is called with certain values of `x`, `filt!(buffer, ::FIRFilter{FIRArbitrary}, x)` tries to write one sample too many to the buffer and a `BoundsError` is thrown. Add one extra sample to the buffer to catch these exceptional cases. (This code is really a hack and simply works around the deeper problem of calculating the correct output buffer length; this should instead be addressed properly in a future change.) Closes #317. (cherry picked from commit 73d3214)
In some cases when
filt(::FIRFilter{FIRArbitrary}, x)
is calledwith certain values of
x
, the buffer is actually one sample tooshort and a
BoundsError
is thrown infilt!(buffer, ::FIRFilter{FIRArbitrary}, x)
. Add one extra sampleto the calculated buffer length to catch these exceptional cases, which
mostly arise when resampling with particular resampling ratios.
(This code is really a hack and simply works around the deeper problem
of
calculating the correct output buffer lengthwriting the correct number of points infilt!
; this should instead beaddressed properly in a future change.)
Closes #317.