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

Allow different argument eltypes for filt_stepstate (fix #573) #574

Merged
merged 8 commits into from
Oct 29, 2024

Conversation

wheeheee
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.40%. Comparing base (dcef684) to head (57560e0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #574   +/-   ##
=======================================
  Coverage   97.40%   97.40%           
=======================================
  Files          16       16           
  Lines        3193     3199    +6     
=======================================
+ Hits         3110     3116    +6     
  Misses         83       83           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@martinholters martinholters left a comment

Choose a reason for hiding this comment

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

A test for the isone(a[1]) && T !== V case would be good. Or remove that optimization and do the scaling unconditionally. Run-time will be dwarfed by the linear solver for computation of si anyway, I guess.

But I don't think this fixes #573 as that issue is about missing documentation which this PR doesn't add.

@wheeheee
Copy link
Contributor Author

IIUC, it's just repeating the two-argument version for each column of an array?

@martinholters
Copy link
Member

IIUC, it's just repeating the two-argument version for each column of an array?

I think the issue is that we only have filtfilt(coef::FilterCoefficients, x::AbstractArray) documented, not filtfilt(b, a, x).

@wheeheee
Copy link
Contributor Author

Oh, seems filtfilt(b::AbstractVector, x::AbstractArray) is also not documented?

@wheeheee
Copy link
Contributor Author

wheeheee commented Oct 29, 2024

A test for the isone(a[1]) && T !== V case would be good.

Isn't that case covered in lines 381 to 383?
edit: Oh, sorry, that kind of test...

src/Filters/filt.jl Outdated Show resolved Hide resolved
src/Filters/filt.jl Outdated Show resolved Hide resolved
@martinholters
Copy link
Member

martinholters commented Oct 29, 2024

Isn't that case covered in lines 381 to 383?
edit: Oh, sorry, that kind of test...

That needs a test where a and b have an eltype that changes under division (e.g. both are Vector{Int}), while your latest test includes an x::Vector{Int} but still b::Vector{Float64}, so those lines are still not covered.

@wheeheee
Copy link
Contributor Author

yeah, slipped my eye. hope it's good now

@martinholters martinholters merged commit 04e4593 into master Oct 29, 2024
11 checks passed
@martinholters martinholters deleted the wheeheee-patch-1 branch October 29, 2024 10:49
wheeheee added a commit to wheeheee/DSP.jl that referenced this pull request Oct 30, 2024
…) (JuliaDSP#574)

* Relax `filt_stepstate` argument types

* set maximum `pad_length` for `iir_filtfilt`

* directly use `_filt_iir!`

avoids unnecessary allocations esp. if x has >1 column

* Document `filtfilt(::AbstractVector...)`  (fixes JuliaDSP#573)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants