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

    Compute cubic spline coefficients for rank-1 array.

    Find the cubic spline coefficients for a 1-D signal assuming
    mirror-symmetric boundary conditions. To obtain the signal back from the
    spline representation mirror-symmetric-convolve these coefficients with a
    length 3 FIR window [1.0, 4.0, 1.0]/ 6.0 .

    Parameters
    ----------
    signal : ndarray
        A rank-1 array representing samples of a signal.
    lamb : float, optional
        Smoothing coefficient, default is 0.0.

    Returns
    -------
    c : ndarray
        Cubic spline coefficients.

    See Also
    --------
    cspline1d_eval : Evaluate a cubic spline at the new set of points.

    Examples
    --------
    We can filter a signal to reduce and smooth out high-frequency noise with
    a cubic spline:

    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy.signal import cspline1d, cspline1d_eval
    >>> rng = np.random.default_rng()
    >>> sig = np.repeat([0., 1., 0.], 100)
    >>> sig += rng.standard_normal(len(sig))*0.05  # add noise
    >>> time = np.linspace(0, len(sig))
    >>> filtered = cspline1d_eval(cspline1d(sig), time)
    >>> plt.plot(sig, label="signal")
    >>> plt.plot(time, filtered, label="filtered")
    >>> plt.legend()
    >>> plt.show()

    
=== parse numpydoc
short_description: 'Compute cubic spline coefficients for rank-1 array.'
long_description: |
  Find the cubic spline coefficients for a 1-D signal assuming
  mirror-symmetric boundary conditions. To obtain the signal back from the
  spline representation mirror-symmetric-convolve these coefficients with a
  length 3 FIR window [1.0, 4.0, 1.0]/ 6.0 .
blank_after_short_description: True
blank_after_long_description: True
style: numpydoc
- DocstringParam
  description: 'A rank-1 array representing samples of a signal.'
  kind: param
  key: 'param'
  arg_name: 'signal'
  type_name: 'ndarray'
  is_optional: False
- DocstringParam
  description: 'Smoothing coefficient, default is 0.0.'
  kind: param
  key: 'param'
  arg_name: 'lamb'
  type_name: 'float'
  is_optional: True
  default: '0.0'
  raw_type_name: 'float, optional'
- DocstringReturns
  description: 'Cubic spline coefficients.'
  kind: returns
  key: 'returns'
  type_name: 'ndarray'
  is_generator: False
  return_name: 'c'
- DocstringMeta
  description: 'cspline1d_eval : Evaluate a cubic spline at the new set of points.'
  kind: text
  key: 'see_also'
  title: 'See Also'
- DocstringExample
  description: |
    We can filter a signal to reduce and smooth out high-frequency noise with
    a cubic spline:
  kind: examples
  key: 'examples'
  snippet: '>>> import numpy as np'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> import matplotlib.pyplot as plt'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> from scipy.signal import cspline1d, cspline1d_eval'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> rng = np.random.default_rng()'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> sig = np.repeat([0., 1., 0.], 100)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> sig += rng.standard_normal(len(sig))*0.05  # add noise'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> time = np.linspace(0, len(sig))'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> filtered = cspline1d_eval(cspline1d(sig), time)'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.plot(sig, label="signal")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.plot(time, filtered, label="filtered")'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.legend()'
- DocstringExample
  kind: examples
  key: 'examples'
  snippet: '>>> plt.show()'
=== detect
numpydoc
=== compose numpydoc
Compute cubic spline coefficients for rank-1 array.

Find the cubic spline coefficients for a 1-D signal assuming
mirror-symmetric boundary conditions. To obtain the signal back from the
spline representation mirror-symmetric-convolve these coefficients with a
length 3 FIR window [1.0, 4.0, 1.0]/ 6.0 .

Parameters
----------
signal : ndarray
    A rank-1 array representing samples of a signal.
lamb : float, optional
    Smoothing coefficient, default is 0.0.

Returns
-------
c : ndarray
    Cubic spline coefficients.

See Also
--------
cspline1d_eval : Evaluate a cubic spline at the new set of points.

Examples
--------
We can filter a signal to reduce and smooth out high-frequency noise with
a cubic spline:

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from scipy.signal import cspline1d, cspline1d_eval
>>> rng = np.random.default_rng()
>>> sig = np.repeat([0., 1., 0.], 100)
>>> sig += rng.standard_normal(len(sig))*0.05  # add noise
>>> time = np.linspace(0, len(sig))
>>> filtered = cspline1d_eval(cspline1d(sig), time)
>>> plt.plot(sig, label="signal")
>>> plt.plot(time, filtered, label="filtered")
>>> plt.legend()
>>> plt.show()
