§
    ¢éUgs=  ã                   óì   — d dl mZmZmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZ ddlmZmZ ddlmZmZmZ d dlmZ g d¢Zdd„Zi Zd	„ Zd
„ Zd„ Z d„ Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&dd„Z'dd„Z(dd„Z)dd„Z*dS )é    )ÚasarrayÚpiÚ
zeros_likeÚarrayÚarctan2ÚtanÚonesÚarangeÚfloorÚr_Ú
atleast_1dÚsqrtÚexpÚgreaterÚcosÚaddÚsiné   )Ú	cspline2dÚsepfir2d)ÚlfilterÚsosfiltÚlfiltic)ÚBSpline)Úspline_filterÚgauss_splineÚ	cspline1dÚ	qspline1dÚcspline1d_evalÚqspline1d_evalç      @c                 óÞ  — | j         j        }t          g d¢d¦  «        dz  }|dv r}|                      d¦  «        } t	          | j        |¦  «        }t	          | j        |¦  «        }t          |||¦  «        }t          |||¦  «        }|d|z  z                        |¦  «        }nJ|dv r7t	          | |¦  «        }t          |||¦  «        }|                     |¦  «        }nt          d¦  «        ‚|S )	a4  Smoothing spline (cubic) filtering of a rank-2 array.

    Filter an input data set, `Iin`, using a (cubic) smoothing spline of
    fall-off `lmbda`.

    Parameters
    ----------
    Iin : array_like
        input data set
    lmbda : float, optional
        spline smooghing fall-off value, default is `5.0`.

    Returns
    -------
    res : ndarray
        filtered input data

    Examples
    --------
    We can filter an multi dimensional signal (ex: 2D image) using cubic
    B-spline filter:

    >>> import numpy as np
    >>> from scipy.signal import spline_filter
    >>> import matplotlib.pyplot as plt
    >>> orig_img = np.eye(20)  # create an image
    >>> orig_img[10, :] = 1.0
    >>> sp_filter = spline_filter(orig_img, lmbda=0.1)
    >>> f, ax = plt.subplots(1, 2, sharex=True)
    >>> for ind, data in enumerate([[orig_img, "original image"],
    ...                             [sp_filter, "spline filter"]]):
    ...     ax[ind].imshow(data[0], cmap='gray_r')
    ...     ax[ind].set_title(data[1])
    >>> plt.tight_layout()
    >>> plt.show()

    )ç      ð?g      @r#   Úfç      @)ÚFÚDr&   y              ð?)r$   ÚdzInvalid data type for Iin)	ÚdtypeÚcharr   Úastyper   ÚrealÚimagr   Ú	TypeError)	ÚIinÚlmbdaÚintypeÚhcolÚckrÚckiÚoutrÚoutiÚouts	            úU/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/scipy/signal/_bsplines.pyr   r      sô   € ðL ŒYŒ^€FÝ��� #Ñ&Ô&¨Ñ,€DØ�ÐÐØ�jŠj˜‰oŒoˆÝ˜œ %Ñ(Ô(ˆÝ˜œ %Ñ(Ô(ˆÝ˜˜T 4Ñ(Ô(ˆÝ˜˜T 4Ñ(Ô(ˆØ�b˜4‘iÑ×'Ò'¨Ñ/Ô/ˆˆØ	�:Ð	Ð	Ý˜˜UÑ#Ô#ˆÝ�s˜D $Ñ'Ô'ˆØ�jŠj˜Ñ Ô ˆˆåÐ3Ñ4Ô4Ð4Ø€Jó    c                 óž   — t          | ¦  «        } |dz   dz  }dt          dt          z  |z  ¦  «        z  t          | dz   dz  |z  ¦  «        z  S )a—  Gaussian approximation to B-spline basis function of order n.

    Parameters
    ----------
    x : array_like
        a knot vector
    n : int
        The order of the spline. Must be non-negative, i.e., n >= 0

    Returns
    -------
    res : ndarray
        B-spline basis function values approximated by a zero-mean Gaussian
        function.

    Notes
    -----
    The B-spline basis function can be approximated well by a zero-mean
    Gaussian function with standard-deviation equal to :math:`\sigma=(n+1)/12`
    for large `n` :

    .. math::  \frac{1}{\sqrt {2\pi\sigma^2}}exp(-\frac{x^2}{2\sigma})

    References
    ----------
    .. [1] Bouma H., Vilanova A., Bescos J.O., ter Haar Romeny B.M., Gerritsen
       F.A. (2007) Fast and Accurate Gaussian Derivatives Based on B-Splines. In:
       Sgallari F., Murli A., Paragios N. (eds) Scale Space and Variational
       Methods in Computer Vision. SSVM 2007. Lecture Notes in Computer
       Science, vol 4485. Springer, Berlin, Heidelberg
    .. [2] http://folk.uio.no/inf3330/scripting/doc/python/SciPy/tutorial/old/node24.html

    Examples
    --------
    We can calculate B-Spline basis functions approximated by a gaussian
    distribution:

    >>> import numpy as np
    >>> from scipy.signal import gauss_spline
    >>> knots = np.array([-1.0, 0.0, -1.0])
    >>> gauss_spline(knots, 3)
    array([0.15418033, 0.6909883, 0.15418033])  # may vary

    r   g      (@é   )r   r   r   r   )ÚxÚnÚsignsqs      r8   r   r   J   sT   € õZ 	�‰
Œ
€AØ�!‰e�t‰^€FØ�t�A�‘F˜V‘OÑ$Ô$Ñ$¥s¨A°©F¨7°Q©;¸Ñ+?Ñ'@Ô'@Ñ@Ð@r9   c                 ó˜   — t          | t          ¬¦  «        } t          j        g d¢d¬¦  «        } || ¦  «        }d|| dk     | dk    z  <   |S )N©r)   )éþÿÿÿéÿÿÿÿr   r   r;   F©Úextrapolater   rA   r;   )r   Úfloatr   Úbasis_element©r<   Úbr7   s      r8   Ú_cubicrI   |   sY   € Ý��ÐÑÔ€AÝÔÐ/Ð/Ð/¸UÐCÑCÔC€AØ
ˆ!ˆA‰$Œ$€CØ€CˆˆRŠ�A˜’EÑÑØ€Jr9   c                 ó²   — t          t          | t          ¬¦  «        ¦  «        } t          j        g d¢d¬¦  «        } || ¦  «        }d|| dk     | dk    z  <   |S )Nr@   )ç      ø¿g      à¿g      à?ç      ø?FrC   r   rK   rL   )Úabsr   rE   r   rF   rG   s      r8   Ú
_quadraticrN   „   sa   € Ý�G�A�UÐ#Ñ#Ô#Ñ$Ô$€AÝÔÐ4Ð4Ð4À%ÐHÑHÔH€AØ
ˆ!ˆA‰$Œ$€CØ"#€CˆˆTŠ�a˜#’gÑÑØ€Jr9   c           
      óV  — dd| z  z
  d| z  t          dd| z  z   ¦  «        z  z   }t          t          d| z  dz
  ¦  «        t          |¦  «        ¦  «        }d| z  dz
  t          |¦  «        z
  d| z  z  }|t          d| z  d| z  t          dd| z  z   ¦  «        z  z   |z  ¦  «        z  }||fS )Nr   é`   é   é   é�   é0   )r   r   )ÚlamÚxiÚomegÚrhos       r8   Ú_coeff_smoothrY   Œ   s¶   € Ø	
ˆR�#‰X‰˜˜S™¥4¨¨C°#©I©Ñ#6Ô#6Ñ6Ñ	6€BÝ•4˜˜c™	 A™Ñ&Ô&­¨R©¬Ñ1Ô1€DØ�‰8�a‰<�$˜r™(œ(Ñ" r¨C¡xÑ
0€CØ
•�b˜3‘h  c¡­D°°S¸3±Y±Ñ,?Ô,?Ñ!?Ñ?À2ÑEÑFÔFÑ
F€CØ�ˆ9Ðr9   c                 ó€   — |t          |¦  «        z  || z  z  t          || dz   z  ¦  «        z  t          | d¦  «        z  S )Nr   rB   )r   r   )ÚkÚcsrX   Úomegas       r8   Ú_hcr^   ”   sB   € Ø•�U‘”‰O˜s a™xÑ(­3¨u¸¸A¹©Ñ+?Ô+?Ñ?Ý�A�r‰NŒNñð r9   c                 ó<  — ||z  d||z  z   z  d||z  z
  z  dd|z  |z  t          d|z  ¦  «        z  z
  |dz  z   z  }d||z  z
  d||z  z   z  t          |¦  «        z  }t          | ¦  «        }|||z  z  t          ||z  ¦  «        |t          ||z  ¦  «        z  z   z  S )Nr   r;   é   )r   r   rM   r   )r[   r\   rX   r]   Úc0ÚgammaÚaks          r8   Ú_hsrd   ™   s³   € Ø
ˆr‰'�Q˜˜s™‘]Ñ
# q¨3°©9¡}Ñ
5Øˆq�3‰w˜‰}�s 1 u¡9™~œ~Ñ-Ñ-°°q±Ñ8ñ:€Bà��s‘‰]˜q 3¨¡9™}Ñ-µ°E±
´
Ñ:€EÝ	ˆQ‰Œ€BØ��r‘	‰>�S ¨¡™_œ_¨uµs¸5À2¹:±´Ñ/FÑFÑGÐGr9   c           	      ó¶  — t          |¦  «        \  }}dd|z  t          |¦  «        z  z
  ||z  z   }t          | ¦  «        }t          |¦  «        }t	          d|||¦  «        | d         z  t          j        t	          |dz   |||¦  «        | z  ¦  «        z   }t	          d|||¦  «        | d         z  t	          d|||¦  «        | d         z  z   t          j        t	          |dz   |||¦  «        | z  ¦  «        z   }t          |t          dd|z  t          |¦  «        z  ||z  f         t          ||f         ¦  «        }	|	 	                    dd¦  «        }	t          |dddd|z  t          |¦  «        z  ||z  f         }
|
 	                    dd¦  «        }
t          |
| dd …         |	¬¦  «        \  }}t          |||f         }t          j        t          ||||¦  «        t          |dz   |||¦  «        z   | d d d…         z  ¦  «        }t          j        t          |dz
  |||¦  «        t          |dz   |||¦  «        z   | d d d…         z  ¦  «        }t          |t          dd|z  t          |¦  «        z  ||z  f         t          ||f         ¦  «        }	|	 	                    dd¦  «        }	t          |
|dd d…         |	¬¦  «        \  }}t          |d d d…         ||f         }|S )Nr   r;   r   rA   rB   ©Úziéýÿÿÿ)rY   r   Úlenr
   r^   r   Úreducer   r   Úreshaper   rd   )ÚsignalÚlambrX   r]   r\   ÚKr[   Úzi_2Úzi_1rg   ÚsosÚypÚ_Úys                 r8   Ú_cubic_smooth_coeffru   ¡   sã  € Ý˜tÑ$Ô$�J€CˆØ	
ˆQ�‰W•s˜5‘z”zÑ!Ñ	! C¨#¡IÑ	-€BÝˆF‰Œ€AÝˆq‰	Œ	€Aå��2�s˜EÑ"Ô" V¨A¤YÑ.ÝŒJ•s˜1˜q™5 " c¨5Ñ1Ô1°FÑ:Ñ;Ô;ñ<€Då��2�s˜EÑ"Ô" V¨A¤YÑ.Ý��2�s˜EÑ"Ô" V¨A¤YÑ.ñ/åŒJ•s˜1˜q™5 " c¨5Ñ1Ô1°FÑ:Ñ;Ô;ñ<€Dõ 
�•R˜˜2 ™8¥c¨%¡j¤jÑ0°#¸±)Ð;Ô<½bÀÀtÀ¼nÑ	MÔ	M€BØ	�Š�A�rÑ	Ô	€Bå
ˆR��A�q˜"˜s™(¥S¨¡Z¤ZÑ/°°s±Ð:Ô
;€CØ
�+Š+�a˜Ñ
Ô
€Cå�C˜   œ¨Ð+Ñ+Ô+�E€BˆÝ	ˆD�$˜ˆNÔ	€Bõ Œ:•s˜1˜b # uÑ-Ô-Ý˜1˜q™5 " c¨5Ñ1Ô1ñ2Ø5;¸D¸D¸b¸D´\ñBñ Cô C€DåŒ:•s˜1˜q™5 " c¨5Ñ1Ô1Ý˜1˜q™5 " c¨5Ñ1Ô1ñ2Ø5;¸D¸D¸b¸D´\ñBñ Cô C€Dõ 
�•R˜˜2 ™8¥c¨%¡j¤jÑ0°#¸±)Ð;Ô<½bÀÀtÀ¼nÑ	MÔ	M€BØ	�Š�A�rÑ	Ô	€BÝ�3˜˜2˜6˜r˜6œ
 rÐ*Ñ*Ô*�D€A€qÝ
ˆ1ˆTˆTˆrˆTŒ7�D˜$ÐÔ€AØ€Hr9   c           
      óö  — dt          d¦  «        z   }t          | ¦  «        }|t          |¦  «        z  }|dk    r=| d         |t          j        || z  ¦  «        z  z   }||dz
  z  |z  }t          |¦  «        S t          dt          d| f         t          t          j        || z  ¦  «        ¦  «        ¦  «        }t          d¦  «        }t          d| f         }t          ||| |¬¦  «        \  }}	||dz
  z  ||dz
           z  }
t          | t          d| f         t          |
¦  «        ¦  «        }t          | g¦  «        }t          |||dd d…         |¬¦  «        \  }}	t          |d d d…         |
f         }|dz  S )NrA   rR   r   r   rf   rB   r%   ©r   ri   r
   r   rj   r   r   r   r	   r   r   ©rl   rg   rn   ÚpowersÚyplusÚoutputÚstaterH   Úars   Úout_lasts              r8   Ú_cubic_coeffr   Ë   ss  € Ø	�d�1‰gŒg‰€BÝˆF‰Œ€AØ•6˜!‘9”9‰_€FàˆA‚v€vØ�q”	˜B¥¤¨F°V©OÑ!<Ô!<Ñ<Ñ<ˆØ�r˜A‘v‘ Ñ&ˆÝ˜&Ñ!Ô!Ð!õ �A•r˜!˜b˜S˜&”z¥:­c¬j¸À&¹Ñ.IÔ.IÑ#JÔ#JÑKÔK€EåˆQ‰Œ€AÝ
ˆ1ˆrˆcˆ6Œ
€AÝ�q˜!˜V¨Ð.Ñ.Ô.�H€Eˆ1ð �R˜!‘V‰}˜u Q¨¡Uœ|Ñ+€HÝ�R�C�˜A ˜s˜Fœ¥Z°Ñ%9Ô%9Ñ:Ô:€Eå�"��‰Œ€AÝ˜˜1˜e B F¨ Fœm°Ð6Ñ6Ô6�I€FˆAÝ��t�t˜�t”˜hÐ&Ô'€FØ�C‰<Ðr9   c           
      óü  — ddt          d¦  «        z  z   }t          | ¦  «        }|t          |¦  «        z  }|dk    r=| d         |t          j        || z  ¦  «        z  z   }||dz
  z  |z  }t          |¦  «        S t          dt          d| f         t          t          j        || z  ¦  «        ¦  «        ¦  «        }t          d¦  «        }t          d| f         }t          ||| |¬¦  «        \  }}	||dz
  z  ||dz
           z  }
t          | t          d| f         t          |
¦  «        ¦  «        }t          | g¦  «        }t          |||dd d…         |¬¦  «        \  }}	t          |d d d…         |
f         }|d	z  S )
Nrh   r;   g       @r   r   rf   rA   rB   g       @rw   rx   s              r8   Ú_quadratic_coeffr�   í   sx  € Ø	ˆa•$�s‘)”)‰mÑ	€BÝˆF‰Œ€AØ•6˜!‘9”9‰_€FàˆA‚v€vØ�q”	˜B¥¤¨F°V©OÑ!<Ô!<Ñ<Ñ<ˆØ�r˜A‘v‘ Ñ&ˆÝ˜&Ñ!Ô!Ð!õ �A•r˜!˜b˜S˜&”z¥:­c¬j¸À&¹Ñ.IÔ.IÑ#JÔ#JÑKÔK€EåˆQ‰Œ€AÝ
ˆ1ˆrˆcˆ6Œ
€AÝ�q˜!˜V¨Ð.Ñ.Ô.�H€Eˆ1ð �R˜!‘V‰}˜u Q¨¡Uœ|Ñ+€HÝ�R�C�˜A ˜s˜Fœ¥Z°Ñ%9Ô%9Ñ:Ô:€Eå�"��‰Œ€AÝ˜˜1˜e B F¨ Fœm°Ð6Ñ6Ô6�I€FˆAÝ��t�t˜�t”˜hÐ&Ô'€FØ�C‰<Ðr9   ç        c                 óL   — |dk    rt          | |¦  «        S t          | ¦  «        S )a  
    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()

    r‚   )ru   r   ©rl   rm   s     r8   r   r     s,   € ðX ˆs‚{€{Ý" 6¨4Ñ0Ô0Ð0å˜FÑ#Ô#Ð#r9   c                 óJ   — |dk    rt          d¦  «        ‚t          | ¦  «        S )aF  Compute quadratic spline coefficients for rank-1 array.

    Parameters
    ----------
    signal : ndarray
        A rank-1 array representing samples of a signal.
    lamb : float, optional
        Smoothing coefficient (must be zero for now).

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

    See Also
    --------
    qspline1d_eval : Evaluate a quadratic spline at the new set of points.

    Notes
    -----
    Find the quadratic 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, 6.0, 1.0]/ 8.0 .

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

    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy.signal import qspline1d, qspline1d_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 = qspline1d_eval(qspline1d(sig), time)
    >>> plt.plot(sig, label="signal")
    >>> plt.plot(time, filtered, label="filtered")
    >>> plt.legend()
    >>> plt.show()

    r‚   z.Smoothing quadratic splines not supported yet.)Ú
ValueErrorr�   r„   s     r8   r   r   A  s+   € ðZ ˆs‚{€{ÝÐIÑJÔJÐJå Ñ'Ô'Ð'r9   r#   c                 ó¦  — t          |¦  «        |z
  t          |¦  «        z  }t          || j        ¬¦  «        }|j        dk    r|S t          | ¦  «        }|dk     }||dz
  k    }||z   }t          | ||          ¦  «        ||<   t          | d|dz
  z  ||         z
  ¦  «        ||<   ||         }|j        dk    r|S t          || j        ¬¦  «        }	t          |dz
  ¦  «                             t          ¦  «        dz   }
t          d¦  «        D ]>}|
|z   }|                     d|dz
  ¦  «        }|	| |         t          ||z
  ¦  «        z  z  }	Œ?|	||<   |S )a±  Evaluate a cubic spline at the new set of points.

    `dx` is the old sample-spacing while `x0` was the old origin. In
    other-words the old-sample points (knot-points) for which the `cj`
    represent spline coefficients were at equally-spaced points of:

      oldx = x0 + j*dx  j=0...N-1, with N=len(cj)

    Edges are handled using mirror-symmetric boundary conditions.

    Parameters
    ----------
    cj : ndarray
        cublic spline coefficients
    newx : ndarray
        New set of points.
    dx : float, optional
        Old sample-spacing, the default value is 1.0.
    x0 : int, optional
        Old origin, the default value is 0.

    Returns
    -------
    res : ndarray
        Evaluated a cubic spline points.

    See Also
    --------
    cspline1d : Compute cubic spline coefficients for rank-1 array.

    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()

    r@   r   r   r;   r`   )r   rE   r   r)   Úsizeri   r   r   r+   ÚintÚrangeÚcliprI   ©ÚcjÚnewxÚdxÚx0ÚresÚNÚcond1Úcond2Úcond3ÚresultÚjlowerÚiÚthisjÚindjs                 r8   r   r   t  sa  € õd �D‰MŒM˜BÑ¥%¨¡)¤)Ñ+€DÝ
�T ¤Ð
*Ñ
*Ô
*€CØ
„x�1‚}€}Øˆ
ÝˆB‰Œ€AØ�1ŠH€EØ�A˜‘EŠN€EØ�e‰mÐ€Eå  T¨%¤[ LÑ1Ô1€Cˆ�JÝ  A¨¨Q©¡K°$°u´+Ñ$=Ñ>Ô>€Cˆ�JØ�Œ;€DØ„y�A‚~€~Øˆ
Ý˜ B¤HÐ-Ñ-Ô-€FÝ�4˜!‘8‰_Œ_×#Ò#¥CÑ(Ô(¨1Ñ,€FÝ�1‰XŒXð 2ð 2ˆØ˜‘
ˆØ�zŠz˜!˜Q ™UÑ#Ô#ˆØ�"�T”(�V D¨5¡LÑ1Ô1Ñ1Ñ1ˆˆØ€Cˆ�JØ€Jr9   c                 óp  — t          |¦  «        |z
  |z  }t          |¦  «        }|j        dk    r|S t          | ¦  «        }|dk     }||dz
  k    }||z   }t	          | ||          ¦  «        ||<   t	          | d|dz
  z  ||         z
  ¦  «        ||<   ||         }|j        dk    r|S t          |¦  «        }	t          |dz
  ¦  «                             t          ¦  «        dz   }
t          d¦  «        D ]>}|
|z   }| 	                    d|dz
  ¦  «        }|	| |         t          ||z
  ¦  «        z  z  }	Œ?|	||<   |S )aÙ  Evaluate a quadratic spline at the new set of points.

    Parameters
    ----------
    cj : ndarray
        Quadratic spline coefficients
    newx : ndarray
        New set of points.
    dx : float, optional
        Old sample-spacing, the default value is 1.0.
    x0 : int, optional
        Old origin, the default value is 0.

    Returns
    -------
    res : ndarray
        Evaluated a quadratic spline points.

    See Also
    --------
    qspline1d : Compute quadratic spline coefficients for rank-1 array.

    Notes
    -----
    `dx` is the old sample-spacing while `x0` was the old origin. In
    other-words the old-sample points (knot-points) for which the `cj`
    represent spline coefficients were at equally-spaced points of::

      oldx = x0 + j*dx  j=0...N-1, with N=len(cj)

    Edges are handled using mirror-symmetric boundary conditions.

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

    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy.signal import qspline1d, qspline1d_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 = qspline1d_eval(qspline1d(sig), time)
    >>> plt.plot(sig, label="signal")
    >>> plt.plot(time, filtered, label="filtered")
    >>> plt.legend()
    >>> plt.show()

    r   r   r;   rL   rR   )r   r   rˆ   ri   r    r   r+   r‰   rŠ   r‹   rN   rŒ   s                 r8   r    r    ¾  sO  € õh �D‰MŒM˜BÑ "Ñ$€DÝ
�TÑ
Ô
€CØ
„x�1‚}€}Øˆ
ÝˆB‰Œ€AØ�1ŠH€EØ�A˜‘EŠN€EØ�e‰mÐ€Eå  T¨%¤[ LÑ1Ô1€Cˆ�JÝ  A¨¨Q©¡K°$°u´+Ñ$=Ñ>Ô>€Cˆ�JØ�Œ;€DØ„y�A‚~€~Øˆ
Ý˜ÑÔ€FÝ�4˜#‘:ÑÔ×%Ò%¥cÑ*Ô*¨QÑ.€FÝ�1‰XŒXð 6ð 6ˆØ˜‘
ˆØ�zŠz˜!˜Q ™UÑ#Ô#ˆØ�"�T”(�Z¨¨u©Ñ5Ô5Ñ5Ñ5ˆˆØ€Cˆ�JØ€Jr9   N)r!   )r‚   )r#   r   )+Únumpyr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   Ú_spliner   r   Ú_signaltoolsr   r   r   Úscipy.interpolater   Ú__all__r   Ú_splinefunc_cacher   rI   rN   rY   r^   rd   ru   r   r�   r   r   r   r    © r9   r8   ú<module>r£      s\  ððFð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð Fð
 )Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3à %Ð %Ð %Ð %Ð %Ð %ðIð Ið I€ð5ð 5ð 5ð 5ðp Ð ð/Að /Að /Aðdð ð ðð ð ðð ð ðð ð ð
Hð Hð Hð'ð 'ð 'ðTð ð ðDð ð ðD/$ð /$ð /$ð /$ðd0(ð 0(ð 0(ð 0(ðfGð Gð Gð GðTIð Ið Ið Ið Ið Ir9   