neurodsp.plts.plot_impulse_response

neurodsp.plts.plot_impulse_response(fs, impulse_response, ax=None, **kwargs)[source]

Plot the impulse response of a filter.

Parameters
fsfloat

Sampling rate, in Hz.

impulse_response1d array

The impulse response of a filter.

axmatplotlib.Axes, optional

Figure axes upon which to plot.

**kwargs

Keyword arguments for customizing the plot.

Examples

Plot the impulse response of an FIR bandpass filter:

>>> from neurodsp.filt import design_fir_filter
>>> from neurodsp.filt.utils import compute_frequency_response
>>> fs = 500
>>> filter_coefs = design_fir_filter(fs, pass_type='bandpass', f_range=(1, 40))
>>> plot_impulse_response(fs, filter_coefs)