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

Output of FIR filter design methods is not compatible with functions that expects FilterCoefficients #511

Open
minecraft2048 opened this issue Nov 7, 2023 · 1 comment

Comments

@minecraft2048
Copy link

This works as expected:

responsetype = Lowpass(0.2)
designmethod = Elliptic(4, 0.5, 30)
coeffs = digitalfilter(responsetype, designmethod)
H,w = freqresp(coeffs)

but if I changed the designmethod to any FIR filter design methods, such as FIRWindow ,freqresp complains with MethodError: no method matching freqresp(::Vector{Float64}) :

responsetype = Lowpass(0.2)
designmethod = FIRWindow(hanning(64)) # <- changed here
coeffs = digitalfilter(responsetype, designmethod)
H,w = freqresp(coeffs) #breaks here
@mbaz
Copy link
Contributor

mbaz commented Nov 7, 2023

This is a known issue, see for example #185

The workaround is to use

PolynomialRatio(coeffs, [1.0])

to convert the vector of coefficients to a filter type that DSP.jl recognizes.

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

No branches or pull requests

2 participants