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

Fix issues with the initial state when a SOS filter has no IIR part #7998

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

andfoy
Copy link
Contributor

@andfoy andfoy commented Nov 27, 2023

Fixes #7990

The issue presented by the OP raised some NaN values, which were caused when sosfilt_zi tried to solve the equation 0x = 0, which was due to a lack of IIR coefficients in the example bessel filter. This change is analogous to this call in lfilter:

y_zi = cupy.nan_to_num(y_zi, nan=0, posinf=cupy.inf, neginf=-cupy.inf)

@takagi
Copy link
Member

takagi commented Nov 29, 2023

/test mini

@takagi takagi modified the milestone: v13.0.0rc1 Nov 29, 2023
Copy link
Member

@takagi takagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@takagi takagi added this to the v13.0.0rc1 milestone Nov 30, 2023
@takagi takagi disabled auto-merge November 30, 2023 09:58
@takagi takagi merged commit b81289d into cupy:main Nov 30, 2023
50 of 51 checks passed
@andfoy andfoy deleted the fix_sosfilt_zi_fir branch December 1, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CUPY sosfilt_zi some SOS coefficients are not supported
3 participants