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

Plotting of FilterCoefficients #226

Open
standarddeviant opened this issue Aug 28, 2018 · 4 comments
Open

Plotting of FilterCoefficients #226

standarddeviant opened this issue Aug 28, 2018 · 4 comments

Comments

@standarddeviant
Copy link

standarddeviant commented Aug 28, 2018

I'm following up on this StatPlots.jl issue: JuliaPlots/StatsPlots.jl#147
And I'm unsure if I can re-open this DSP.jl issue: #203

I have a reasonable prototype of code using RecipesBase.jl here:
https://gist.github.com/standarddeviant/0e676140feca9b938943ebeded05b8e1

The main recipe handles a vector of FilterCoefficients, and there's a version that handles a single FilterCoefficients by making a length-1 vector of FilterCoefficients. I've found this useful to look at time/frequency tradeoffs when varying a single filter parameter.

If you download and run that file, this is a fun plot to make:

orders=[1,2,4,6,8,10]
plot(
    digitalfilter.(
        Lowpass(0.1, fs=10),
        Butterworth.(orders)
    ),
    fs=10,
    desc=orders,
    doimp=true,
    dostep=true
)

The julia dot-syntax is wonderful :-)
dsp_plot

I'm just offering this up as a potential solution to being able to plot and visualize filters in DSP.jl.

@martinholters
Copy link
Member

This does look nice. I think I'd be Ok with adding adding a dependency on RecipesBase and adding this code, but if others prefer to have it live in a dedicated package I wouldn't mind either.

@standarddeviant
Copy link
Author

@martinholters I'm happy to submit a PR to DSP.jl or create "DSPPlots.jl".

@ssfrr
Copy link
Contributor

ssfrr commented Aug 28, 2018

I think a RecipesBase dependency is fine, and this doesn't need to be split out into a separate package.

@martinholters
Copy link
Member

We now transitively depend on RecipesBase anyway (via Polynomials), so even less reason not to do this.

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

3 participants