-
-
Notifications
You must be signed in to change notification settings - Fork 778
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
add iir{notch,comb,peak} design functions #7634
Conversation
This pull request is now in conflicts. Could you fix it @ev-br? 🙏 |
Rebased on main, now that gh-7632 is in. Ready for review from my side. |
/test full |
|
||
a = cupy.r_[1.0, -2.0 * gain * cupy.cos(w0), 2.0 * gain - 1.0] | ||
|
||
return b, a |
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.
How about computing them on CPU and cupy.asarray
just before return as the inputs are Python scalars and the data size is small?
G0, G = 1, 0 | ||
elif ftype == 'peak': | ||
G0, G = 0, 1 | ||
GB = 1 / cupy.sqrt(2) |
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.
Computing on CPU, then setting values to a
and b
on GPU would be okay.
beta = cupy.sqrt((GB**2 - G0**2) / (G**2 - GB**2)) * \ | ||
cupy.tan(N * w_delta / 4) |
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.
ditto (Computing on CPU)
Maybe older iircomb does not have |
Indeed, it only appears in scipy 1.9.x. Will update the PR. |
Pushed the updated PR: move scalar computations to CPU + guard a test for |
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.
LGTM!
/test full |
Would you check |
Indeed, the failing test was checking a bug which was only fixed in scipy 1.9.x , too (scipy/scipy#16145). Added a commit to skip it. |
/test full |
Thanks! I'll merge this after CI finishes. |
Thanks, @ev-br! |
cross-ref #7403
Port IIR filter design functions:
This PR is on top of gh-7632rebased.