JuliaDSP / DSP.jl

Filter design, periodograms, window functions, and other digital signal processing functionality
https://docs.juliadsp.org/stable/contents/
Other
381 stars 109 forks source link

Documentation #560

Closed CWillberg closed 1 month ago

CWillberg commented 5 months ago

What is currently missing in the documentation?

Within the documentation the examples are flawed. Please check them out. It would be nice if there are some more included, because it massively will help to use your nice module.

Can you share related references or the speficic functions you want to document?

https://docs.juliadsp.org/dev/filters/#Examples

Would you be willing to submit a PR?

No

martinholters commented 4 months ago

Within the documentation the examples are flawed. Please check them out.

Could you provide some details in what regard you consider them flawed?

hyperkomplexe commented 1 month ago

I had a similar issue. I should have said something here also sorry. https://discourse.julialang.org/t/dsp-jl-digitalfilter-no-matching-method-when-using-fs-as-argument/117130

fs needs to be moved about.

The documentation says the following:

responsetype = Bandpass(10, 40)
designmethod = Butterworth(4)
filt(digitalfilter(responsetype, designmethod; fs=1000), x)

But it should be:

responsetype = Bandpass(10, 40; fs=1000);
designmethod = Butterworth(4);
filt(digitalfilter(responsetype, designmethod), x);
martinholters commented 1 month ago

Ah, the API has changed, and you need to look at the corresponding versions of docs and implementation. At the stable docs https://docs.juliadsp.org/stable/filters/#Examples (which is for v0.7.9 at the time of writing), the example code reads

responsetype = Bandpass(10, 40; fs=1000)
designmethod = Butterworth(4)
filt(digitalfilter(responsetype, designmethod), x)

Which happens to be what you would like it to be.

OTOH, the dev docs at https://docs.juliadsp.org/dev/filters/#Examples for the not-yet-released v0.8 give

responsetype = Bandpass(10, 40)
designmethod = Butterworth(4)
filt(digitalfilter(responsetype, designmethod; fs=1000), x)

That is indeed how it works in the current dev version to become v0.8 soonish, hopefully.

I've just changed the homepage link on Github to point to the stable docs. Is there another place where a link should be changed to keep users from heading to the dev docs by default?