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

freqz does not support FIRFilters #185

Open
ethomag opened this issue Oct 19, 2017 · 6 comments
Open

freqz does not support FIRFilters #185

ethomag opened this issue Oct 19, 2017 · 6 comments

Comments

@ethomag
Copy link

ethomag commented Oct 19, 2017

julia> f = FIRFilter([.25, 0.5, 0.25]);
julia> freqz(f)
ERROR: MethodError: no method matching freqz(::DSP.Filters.FIRFilter{DSP.Filters.FIRStandard{Float64}})

julia> Pkg.status()
[ ... ]
 - DSP                           0.3.4

I am running Julia 0.6

@martinholters
Copy link
Member

Workaround would be freqz(PolynomialRatio(f.h, [1.0])), but a freqz method that takes a FIRFilter (or maybe a FIRFilter{<:FIRStandard}) directly surely wouldn't hurt.

@ethomag
Copy link
Author

ethomag commented Oct 19, 2017

Thanks Martin! What if I have a decimating FIR filter ?

julia> f = FIRFilter([.25, 0.5, 0.25], 1//2);

@martinholters
Copy link
Member

Yea, in general, if ratio ≠ 1, it is unclear whether freqz should compute the frequency response viewed from the input or output side of the filter. That's why I included the possible restriction to FIRFilter{<:FIRStandard} above 😉

@ethomag
Copy link
Author

ethomag commented Oct 19, 2017

Good point! In MATLAB, I believe freqz delivers a result viewed from the output side of the filter. I guess that would conform to the "rule of least surprise".

@galenlynch
Copy link
Member

freqz still does not accept FIR filters.

@fps
Copy link

fps commented Jan 6, 2021

Hi, this still seems to be the case

(clipping.lv2) pkg> status
Status `C:\Users\fschmidt\syncthing\uni\projects\linux-audio\clipping.lv2\Project.toml`
  [717857b8] DSP v0.6.10
  [91a5bcdd] Plots v1.10.0

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

4 participants