filter

filter(x, b, /, a=1, n=1, axis=- 1, center=True, pad=True, pad_value=nan)[source]

Apply scipy.signal.lfilter to data. By default this does not pad ends of data. May keep it this way.

Parameters
  • x (array-like) – Data to be filtered.

  • b (array-like) – b coefficients (non-recursive component).

  • a (array-like, optional) – a coefficients (recursive component). Default of 1 indicates a non-recursive filter.

  • n (int, optional) – Number of times to filter data. Will go forward –> backward –> forward…

  • axis (int, optional) – Axis along which data is filtered. Defaults to last axis.

  • center (bool, optional) – Whether to trim leading part of axis by number of b coefficients. Will also attempt to re-center the data if a net-forward (e.g. f, fbf, fbfbf, …) filtering was performed. This works for non-recursive filters only.

  • pad (bool, optional) – Whether to pad trimmed values with pad_value when center is True.

  • pad_value (float) – The pad value.

Returns

array-like – Data filtered along axis axis.