diff --git a/README.md b/README.md index f2df4a12b14542c1d95bfd581c0bba8f07ba2da3..8e24e07b92942bb06c93846a4745baf97783fcef 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ To generate the documentation, the following additional packages are required: - [Furo](https://pradyunsg.me/furo/) - [numpydoc](https://numpydoc.readthedocs.io/) - [Sphinx-Gallery](https://sphinx-gallery.github.io/) - - [SciPy](https://scipy.org/) + - [mplsignal](https://mplsignal.readthedocs.io/) ### Using CMake directly diff --git a/docs_sphinx/conf.py b/docs_sphinx/conf.py index 90b049c77ea82b912bad97401eb2f1b2e65d9763..670495e063a727f65a9d6aad5991bbdcc6195042 100644 --- a/docs_sphinx/conf.py +++ b/docs_sphinx/conf.py @@ -40,6 +40,7 @@ intersphinx_mapping = { 'numpy': ('https://numpy.org/doc/stable/', None), 'PyQt5': ("https://www.riverbankcomputing.com/static/Docs/PyQt5", None), 'networkx': ('https://networkx.org/documentation/stable', None), + 'mplsignal': ('https://mplsignal.readthedocs.io/en/stable/', None), } numpydoc_show_class_members = False diff --git a/examples/firstorderiirfilter.py b/examples/firstorderiirfilter.py index 51de36b9638dffb46f967f83041787a626adfc6d..16baebebe0353cb4205e4ce3afb1b209f9cebe00 100644 --- a/examples/firstorderiirfilter.py +++ b/examples/firstorderiirfilter.py @@ -191,15 +191,14 @@ plt.show() # %% -# To compute and plot the frequency response, it is possible to use SciPy and NumPy as +# To compute and plot the frequency response, it is possible to use mplsignal -import numpy as np -import scipy.signal +from mplsignal.freq_plots import freqz_fir -w, h = scipy.signal.freqz(sim.results['0']) -plt.plot(w, 20 * np.log10(np.abs(h))) +freqz_fir(sim.results["0"]) plt.show() + # %% # As seen, the output has not converged to zero, leading to that the frequency-response may not be correct, so we want # to simulate for a longer time. @@ -225,6 +224,5 @@ plt.show() # %% # And the frequency-response: -w, h = scipy.signal.freqz(sim.results['0']) -plt.plot(w, 20 * np.log10(np.abs(h))) +freqz_fir(sim.results["0"]) plt.show() diff --git a/examples/thirdorderblwdf.py b/examples/thirdorderblwdf.py index 663d1314f5e52ec21c140729139dadc6cd514fc1..117041fcecaf2d9e49df26c46363b15c26266119 100644 --- a/examples/thirdorderblwdf.py +++ b/examples/thirdorderblwdf.py @@ -31,13 +31,9 @@ sfg.set_execution_time_of_type(Addition.type_name(), 1) sim = Simulation(sfg, [lambda n: 0 if n else 1]) sim.run_for(1000) -import scipy.signal - -w, h = scipy.signal.freqz(sim.results['0']) - -import matplotlib.pyplot as plt import numpy as np +from mplsignal.freq_plots import freqz_fir -plt.plot(w, 20 * np.log10(np.abs(h) / 2)) +freqz_fir(np.array(sim.results['0']) / 2) schedule = Schedule(sfg, cyclic=True) diff --git a/requirements_doc.txt b/requirements_doc.txt index 6aacbb633e26a5ae1d629e44ee6ac085c0ae1a54..cc10b7636aa5aac13bb8f65591bb824e70e4e57a 100644 --- a/requirements_doc.txt +++ b/requirements_doc.txt @@ -2,4 +2,4 @@ sphinx furo numpydoc sphinx-gallery -scipy +mplsignal