.. sectionauthor:: Duncan Macleod .. currentmodule:: gwpy.plotter Plotting a filter ################# I would like to look at the Bode representation of a linear filter. First, we import the objects we need .. code-block:: python from math import pi from scipy import signal from gwpy.plotter import BodePlot Now, we can calculate a fourth-order butterworth filter using the :meth:`~scipy.signal.butter` function .. code-block:: python highpass = signal.butter(4, 10 * (2. * pi), btype='highpass', analog=True) The `BodePlot` knows how to plot filters: .. code-block:: python plot = BodePlot(highpass) plot.maxes.set_title('10\,Hz high-pass filter (4th order Butterworth)') plot.show() .. plot:: ../examples/miscellaneous/bode_plot.py