{ } Raw JSON

bundles / scipy 1.17.1 / scipy / signal / _signaltools / _filtfilt_gust

function

scipy.signal._signaltools:_filtfilt_gust

source: /scipy/signal/_signaltools.py :4529

Signature

def   _filtfilt_gust ( b a x axis = -1 irlen = None )

Summary

Forward-backward IIR filter that uses Gustafsson's method.

Extended Summary

Apply the IIR filter defined by (b,a) to x twice, first forward then backward, using Gustafsson's initial conditions [1].

Let y_fb be the result of filtering first forward and then backward, and let y_bf be the result of filtering first backward then forward. Gustafsson's method is to compute initial conditions for the forward pass and the backward pass such that y_fb == y_bf.

Parameters

b : scalar or 1-D ndarray

Numerator coefficients of the filter.

a : scalar or 1-D ndarray

Denominator coefficients of the filter.

x : ndarray

Data to be filtered.

axis : int, optional

Axis of x to be filtered. Default is -1.

irlen : int or None, optional

The length of the nonnegligible part of the impulse response. If irlen is None, or if the length of the signal is less than 2 * irlen, then no part of the impulse response is ignored.

Returns

y : ndarray

The filtered data.

x0 : ndarray

Initial condition for the forward filter.

x1 : ndarray

Initial condition for the backward filter.

Notes

Typically the return values x0 and x1 are not needed by the caller. The intended use of these return values is in unit tests.

Aliases

  • scipy.signal._signaltools._filtfilt_gust