# scipy 1.18.1 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

    Construct initial conditions for lfilter given input and output vectors.

    Given a linear filter (b, a) and initial conditions on the output `y`
    and the input `x`, return the initial conditions on the state vector zi
    which is used by `lfilter` to generate the output given the input.

    Parameters
    ----------
    b : array_like
        Linear filter term.
    a : array_like
        Linear filter term.
    y : array_like
        Initial conditions.

        If ``N = len(a) - 1``, then ``y = {y[-1], y[-2], ..., y[-N]}``.

        If `y` is too short, it is padded with zeros.
    x : array_like, optional
        Initial conditions.

        If ``M = len(b) - 1``, then ``x = {x[-1], x[-2], ..., x[-M]}``.

        If `x` is not given, its initial conditions are assumed zero.

        If `x` is too short, it is padded with zeros.

    Returns
    -------
    zi : ndarray
        The state vector ``zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]}``,
        where ``K = max(M, N)``.

    See Also
    --------
    lfilter, lfilter_zi

    
=== parse numpydoc
short_description: 'Construct initial conditions for lfilter given input and output vectors.'
long_description: |
  Given a linear filter (b, a) and initial conditions on the output `y`
  and the input `x`, return the initial conditions on the state vector zi
  which is used by `lfilter` to generate the output given the input.
blank_after_short_description: True
blank_after_long_description: True
style: numpydoc
- DocstringParam
  description: 'Linear filter term.'
  kind: param
  key: 'param'
  arg_name: 'b'
  type_name: 'array_like'
  is_optional: False
- DocstringParam
  description: 'Linear filter term.'
  kind: param
  key: 'param'
  arg_name: 'a'
  type_name: 'array_like'
  is_optional: False
- DocstringParam
  description: |
    Initial conditions.
    
    If ``N = len(a) - 1``, then ``y = {y[-1], y[-2], ..., y[-N]}``.
    
    If `y` is too short, it is padded with zeros.
  kind: param
  key: 'param'
  arg_name: 'y'
  type_name: 'array_like'
  is_optional: False
- DocstringParam
  description: |
    Initial conditions.
    
    If ``M = len(b) - 1``, then ``x = {x[-1], x[-2], ..., x[-M]}``.
    
    If `x` is not given, its initial conditions are assumed zero.
    
    If `x` is too short, it is padded with zeros.
  kind: param
  key: 'param'
  arg_name: 'x'
  type_name: 'array_like'
  is_optional: True
  raw_type_name: 'array_like, optional'
- DocstringReturns
  description: |
    The state vector ``zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]}``,
    where ``K = max(M, N)``.
  kind: returns
  key: 'returns'
  type_name: 'ndarray'
  is_generator: False
  return_name: 'zi'
- DocstringMeta
  description: 'lfilter, lfilter_zi'
  kind: text
  key: 'see_also'
  title: 'See Also'
=== detect
numpydoc
=== compose numpydoc
Construct initial conditions for lfilter given input and output vectors.

Given a linear filter (b, a) and initial conditions on the output `y`
and the input `x`, return the initial conditions on the state vector zi
which is used by `lfilter` to generate the output given the input.

Parameters
----------
b : array_like
    Linear filter term.
a : array_like
    Linear filter term.
y : array_like
    Initial conditions.

    If ``N = len(a) - 1``, then ``y = {y[-1], y[-2], ..., y[-N]}``.

    If `y` is too short, it is padded with zeros.
x : array_like, optional
    Initial conditions.

    If ``M = len(b) - 1``, then ``x = {x[-1], x[-2], ..., x[-M]}``.

    If `x` is not given, its initial conditions are assumed zero.

    If `x` is too short, it is padded with zeros.

Returns
-------
zi : ndarray
    The state vector ``zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]}``,
    where ``K = max(M, N)``.

See Also
--------
lfilter, lfilter_zi
