§
    ¢éUgß>  ã                   ó†   — d dl Z d dlZd dlmZ d dlmZ d dlmZ g d¢Z	dZ
d„ Zd„ Zdd
„Zdd„Zd„ Zd„ Zdd„Zdd„Zdd„ZdS )é    N)Úeig©Úcomb)Úconvolve)ÚdaubÚqmfÚcascadeÚmorletÚrickerÚmorlet2Úcwtzvscipy.signal.%s is deprecated in SciPy 1.12 and will be removed
in SciPy 1.15. We recommend using PyWavelets instead.
c           	      ó"  ‡ — t          j        t          dz  t          d¬¦  «         t          j        }‰ dk     rt          d¦  «        ‚‰ dk    r$d |d¦  «        z  }t	          j        ||g¦  «        S ‰ dk    r@ |d¦  «        dz  } |d¦  «        }|t	          j        d|z   d|z   d|z
  d|z
  g¦  «        z  S ‰ dk    rîd |d	¦  «        z  }d
 |d|z   ¦  «        dz  z   d |d¦  «         ||dz
  ¦  «        z   z  dz  z
  }t	          j        |¦  «        } |d¦  «        dz  }t	          j	        d|z
  d|z
  z  ¦  «        }t	          j	        ||z  ¦  «        }dt	          j	        |¦  «        z  }	||z  t	          j        |d|z  |	z
  d|z  d|	z  z
  dz   |d|	z  z
  dz   d|	z
  dg¦  «        z  S ‰ dk     �rP‰ dk     r9ˆ fd„t          ‰ ¦  «        D ¦   «         ddd…         }
t	          j        |
¦  «        }n;ˆ fd„t          ‰ ¦  «        D ¦   «         ddd…         }
t	          j        |
¦  «        dz  }t	          j        ddg¦  «        ‰ z  }t	          j        dg¦  «        }t          ‰ dz
  ¦  «        D ]K}||         }d |||dz
  z  ¦  «        z  }dd|z  z
  }||z   }t          |¦  «        dk     r||z
  }|d| gz  }ŒL|t	          j	        |¦  «        z  }|t	          j        |¦  «        z   |d¦  «        z  }|j        ddd…         S t          d¦  «        ‚)aù  
    The coefficients for the FIR low-pass filter producing Daubechies wavelets.

    .. deprecated:: 1.12.0

        scipy.signal.daub is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    p>=1 gives the order of the zero at f=1/2.
    There are 2p filter coefficients.

    Parameters
    ----------
    p : int
        Order of the zero at f=1/2, can have values from 1 to 34.

    Returns
    -------
    daub : ndarray
        Return

    r   é   ©Ú
stacklevelé   zp must be at least 1.é   é   é   é
   g      ø?é   é   ù              ð?é#   c                 ó@   •— g | ]}t          ‰d z
  |z   |d ¬¦  «        ‘ŒS )r   ©Úexactr   ©Ú.0ÚkÚps     €úU/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/scipy/signal/_wavelets.pyú
<listcomp>zdaub.<locals>.<listcomp>@   s0   ø€ Ð?Ð?Ð?°•�a˜!‘e˜a‘i ¨!Ð,Ñ,Ô,Ð?Ð?Ð?ó    Néÿÿÿÿc                 óL   •— g | ] }t          ‰d z
  |z   |d ¬¦  «        d|z  z  ‘Œ!S )r   r   g      @r   r   s     €r"   r#   zdaub.<locals>.<listcomp>C   sI   ø€ ð $ð $ð $Øõ �a˜!‘e˜a‘i ¨!Ð,Ñ,Ô,¨s°A©vÑ5ð $ð $ð $r$   é   z<Polynomial factorization does not work well for p too large.)ÚwarningsÚwarnÚ_msgÚDeprecationWarningÚnpÚsqrtÚ
ValueErrorÚarrayÚconjÚrealÚrangeÚrootsÚpoly1dÚabsÚsumÚc)r!   r-   r7   ÚfÚtmpÚz1Úz1cÚd0Úa0Úa1ÚPÚyjÚqr    ÚyvalÚpartÚconsts   `                r"   r   r      so  ø€ õ. „M•$˜‘-Õ!3ÀÐBÑBÔBÐBåŒ7€DØˆ1‚u€uÝÐ0Ñ1Ô1Ð1ØˆA‚v€vØ���Q‘”‰KˆÝŒx˜˜A˜ÑÔÐØ	
ˆaŠˆØˆD�‰GŒG�a‰KˆØˆD�‰GŒGˆØ•2”8˜Q ™U A¨¡E¨1¨q©5°!°a±%Ð8Ñ9Ô9Ñ9Ð9Ø	
ˆaŠˆØ�4�4˜‘8”8‰mˆØ�4�4˜˜S™‘>”> AÑ%Ñ%¨¨d¨d°2©h¬h¸¸¸cÀB¹h¹¼Ñ.GÑ(HÈ1Ñ(LÑLˆÝŒg�b‰kŒkˆØˆD�‰GŒG�a‰KˆÝŒW�a˜"‘f  S¡Ñ)Ñ*Ô*ˆÝŒW�R˜#‘XÑÔˆØ•”˜‘”‰_ˆØ�2‰v�œ " a¨"¡f¨r¡k°1°r±6¸AÀ¹F±?ÀQÑ3FØ"$ q¨2¡v¡+°¡/°1°r±6¸1ð">ñ ?ô ?ñ ?ð 	?à	
ˆRŠ‰àˆrŠ6ˆ6Ø?Ð?Ð?Ð?µe¸A±h´hÐ?Ñ?Ô?ÀÀÀ"ÀÔEˆAÝ”˜!‘”ˆBˆBð$ð $ð $ð $Ý ™(œ(ð$ñ $ô $Ø$( D b Dô*ˆAå”˜!‘”˜q‘ˆBõ ŒI�q˜!�fÑÔ˜qÑ ˆÝŒI�q�c‰NŒNˆÝ�q˜1‘u‘”ð 	ð 	ˆAØ�a”5ˆDØ�t�t˜D D¨1¡HÑ-Ñ.Ô.Ñ.ˆDØ˜˜D™‘LˆEØ˜‘ˆBÝ�B‘”˜1Š}ˆ}Ø˜T‘\�Ø�Q˜˜�H‘ˆAˆAà•”˜‘
”
‰Nˆà•”�q‘	”	‰M˜D˜D ™GœGÑ#ˆØŒs�4�4�R�4ŒyÐåð 1ñ 2ô 2ð 	2r$   c                 óæ   — t          j        t          dz  t          d¬¦  «         t	          | ¦  «        dz
  }d„ t          |dz   ¦  «        D ¦   «         }| ddd…         t          j        |¦  «        z  S )a„  
    Return high-pass qmf filter from low-pass

    .. deprecated:: 1.12.0

        scipy.signal.qmf is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    Parameters
    ----------
    hk : array_like
        Coefficients of high-pass filter.

    Returns
    -------
    array_like
        High-pass filter coefficients.

    r   r   r   r   c                 ó*   — g | ]}d ddœ|dz           ‘ŒS )r   r%   ©r   r   r   © )r   r    s     r"   r#   zqmf.<locals>.<listcomp>s   s'   € Ð7Ð7Ð7 Q��bˆMˆM˜!˜a™%Ô Ð7Ð7Ð7r$   Nr%   )r(   r)   r*   r+   Úlenr2   r,   r/   )ÚhkÚNÚasgns      r"   r   r   \   si   € õ( „M•$˜‘,Õ 2¸qÐAÑAÔAÐAåˆB‰Œ�!‰€AØ7Ð7­%°°A±©,¬,Ð7Ñ7Ô7€DØˆdˆd�ˆdŒ8•b”h˜t‘n”nÑ$Ð$r$   é   c                 ó¶  ‡— t          j        t          dz  t          d¬¦  «         t	          | ¦  «        dz
  }|dt          j        |dz   ¦  «        z
  k    rt          d¦  «        ‚|dk     rt          d¦  «        ‚t
          j        d|…d|…f         \  }}t          j	        d¦  «        }t
          j
        | d	f         }t          | ¦  «        }t
          j
        |d	f         }t          j        d|z  |z
  d
|dz   ¦  «        }	t          j        d|z  |z
  dz   d
|dz   ¦  «        }
t          j        dd||fd¦  «        }t          j        ||	d	¦  «        |d<   t          j        ||
d	¦  «        |d<   t          j        ||	d	¦  «        |d<   t          j        ||
d	¦  «        |d<   ||z  }t          j        d	|d|z  z  t           ¬¦  «        d|z  z  }d	|z  }d	|z  }t#          |d         ¦  «        \  }}t          j        t          j        |dz
  ¦  «        ¦  «        }t          j        |dd…|f         ¦  «        }t          j        |¦  «        }|d	k     r| }| }d||z  i}t          j        |d         |d         ¦  «        |d<   d|z  }|d         |dd|…<   |d         |d|dz
  z  d|…<   t          j        |d         |d         ¦  «        |dd|…<   t          j        |d         |d         ¦  «        |d|dz
  z  d|…<   dgŠt/          d|dz   ¦  «        D ]Å}ˆfd„dD ¦   «         }d||z
  z  }|D ]¨}d	}t/          |¦  «        D ]}||         dk    r|d|dz
  |z
  z  z  }Œ||dd…                  }t1          |d	         ¦  «        }t          j        |d	|f         |¦  «        }|||<   ||||z  d|…<   t          j        |d|f         |¦  «        |||z  d|…<   Œ©|ŠŒÆ|||fS )a˜  
    Return (x, phi, psi) at dyadic points ``K/2**J`` from filter coefficients.

    .. deprecated:: 1.12.0

        scipy.signal.cascade is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    Parameters
    ----------
    hk : array_like
        Coefficients of low-pass filter.
    J : int, optional
        Values will be computed at grid points ``K/2**J``. Default is 7.

    Returns
    -------
    x : ndarray
        The dyadic points ``K/2**J`` for ``K=0...N * (2**J)-1`` where
        ``len(hk) = len(gk) = N+1``.
    phi : ndarray
        The scaling function ``phi(x)`` at `x`:
        ``phi(x) = sum(hk * phi(2x-k))``, where k is from 0 to N.
    psi : ndarray, optional
        The wavelet function ``psi(x)`` at `x`:
        ``phi(x) = sum(gk * phi(2x-k))``, where k is from 0 to N.
        `psi` is only returned if `gk` is not None.

    Notes
    -----
    The algorithm uses the vector cascade algorithm described by Strang and
    Nguyen in "Wavelets and Filter Banks".  It builds a dictionary of values
    and slices for quick reuse.  Then inserts vectors into final vector at the
    end.

    r	   r   r   r   é   zToo many levels.zToo few levels.Nr   r%   Úd)r   r   rG   )r   r   )r   r   ©ÚdtypeÚ0Ú1c                 ó(   •— g | ]}‰D ]	}d ||fz  ‘Œ
ŒS )z%d%srH   )r   ÚxxÚyyÚprevkeyss      €r"   r#   zcascade.<locals>.<listcomp>Õ   s/   ø€ ÐIÐIÐI¨ÀÐIÐI¸"�6˜R ˜HÑ$ÐIÐIÐIÐIr$   )r(   r)   r*   r+   rI   r,   Úlog2r.   Úogridr-   Úr_r   ÚclipÚemptyÚtakeÚarangeÚfloatr   ÚargminÚabsoluter1   r6   Údotr2   Úint)rJ   ÚJrK   ÚnnÚkkÚs2ÚthkÚgkÚtgkÚindx1Úindx2ÚmÚxÚphiÚpsiÚlamÚvÚindÚsmÚbitdicÚstepÚlevelÚnewkeysÚfacÚkeyÚnumÚposÚpastphiÚiiÚtemprX   s                                 @r"   r	   r	   w   s  ø€ õJ „M•$˜Ñ"Õ$6À1ÐEÑEÔEÐEåˆB‰Œ�!‰€Aà	ˆB•”˜˜Q™‘”ÑÒÐÝÐ+Ñ,Ô,Ð,Ø	ˆAŠˆÝÐ*Ñ+Ô+Ð+õ ŒX�b�q�b˜"˜1˜"�fÔ�F€BˆÝ	Œ�‰Œ€Bå
Œ%��A�Œ,€CÝ	ˆR‰Œ€BÝ
Œ%��A�Œ,€CåŒG�A˜‘F˜R‘K  Q¨¡UÑ+Ô+€EÝŒG�A˜‘F˜R‘K !‘O R¨¨Q©Ñ/Ô/€EÝ
Œ�!�Q˜˜1�˜sÑ#Ô#€AÝŒg�c˜5 !Ñ$Ô$€A€d�GÝŒg�c˜5 !Ñ$Ô$€A€d�GÝŒg�c˜5 !Ñ$Ô$€A€d�GÝŒg�c˜5 !Ñ$Ô$€A€d�GØˆ�G€Aõ 	Œ	�!�Q˜!˜q™&‘\­Ð/Ñ/Ô/°1¸±6Ñ:€AØ
ˆa‰%€Cà
ˆa‰%€Cõ ��4”‰\Œ\�F€CˆÝ
Œ)•B”K  a¡Ñ(Ô(Ñ
)Ô
)€Cõ 	Œ��!�!�!�S�&”	ÑÔ€Aõ 
Œ�‰Œ€BØ	ˆA‚v€vØˆBˆØˆSˆØ�1�r‘6ˆ]€FÝ”&˜˜4œ &¨¤+Ñ.Ô.€Fˆ3�KØ�‰6€DØ˜”+€Cˆˆˆ$ˆ�KØ & s¤€Cˆˆq�1‰u‰Ð˜ÐÑÝ”&˜˜4œ &¨¤+Ñ.Ô.€Cˆˆˆ$ˆ�KÝ "¤ q¨¤w°°s´Ñ <Ô <€Cˆˆq�1‰u‰Ð˜ÐÑð
 ˆu€HÝ�q˜!˜a™%‘”ð ð ˆØIÐIÐIÐI¨vÐIÑIÔIˆØ�A˜‘IÑˆØð 	=ð 	=ˆCàˆCÝ˜U‘|”|ð 4ð 4�Ø�s”8˜s’?�?Ø˜A %¨!¡)¨c¡/Ñ2Ñ3�CøØ˜S   œW”oˆGÝ�S˜”V‘”ˆBÝ”6˜!˜A˜r˜Eœ( GÑ,Ô,ˆDØˆF�3‰KØ#'ˆC��c‘	�˜4�Ñ Ý#%¤6¨!¨A¨r¨E¬(°GÑ#<Ô#<ˆC��c‘	�˜4�Ñ Ð Øˆˆàˆc�3ˆ;Ðr$   ç      @ç      ð?Tc                 óˆ  — t          j        t          dz  t          d¬¦  «         t	          j        | dz  t          j        z  |dz  t          j        z  | ¦  «        }t	          j        d|z  |z  ¦  «        }|r|t	          j        d|dz  z  ¦  «        z  }|t	          j        d|dz  z  ¦  «        t          j        dz  z  z  }|S )a%  
    Complex Morlet wavelet.

    .. deprecated:: 1.12.0

        scipy.signal.morlet is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    Parameters
    ----------
    M : int
        Length of the wavelet.
    w : float, optional
        Omega0. Default is 5
    s : float, optional
        Scaling factor, windowed from ``-s*2*pi`` to ``+s*2*pi``. Default is 1.
    complete : bool, optional
        Whether to use the complete or the standard version.

    Returns
    -------
    morlet : (M,) ndarray

    See Also
    --------
    morlet2 : Implementation of Morlet wavelet, compatible with `cwt`.
    scipy.signal.gausspulse

    Notes
    -----
    The standard version::

        pi**-0.25 * exp(1j*w*x) * exp(-0.5*(x**2))

    This commonly used wavelet is often referred to simply as the
    Morlet wavelet.  Note that this simplified version can cause
    admissibility problems at low values of `w`.

    The complete version::

        pi**-0.25 * (exp(1j*w*x) - exp(-0.5*(w**2))) * exp(-0.5*(x**2))

    This version has a correction
    term to improve admissibility. For `w` greater than 5, the
    correction term is negligible.

    Note that the energy of the return wavelet is not normalised
    according to `s`.

    The fundamental frequency of this wavelet in Hz is given
    by ``f = 2*s*w*r / M`` where `r` is the sampling rate.

    Note: This function was created before `cwt` and is not compatible
    with it.

    Examples
    --------
    >>> from scipy import signal
    >>> import matplotlib.pyplot as plt

    >>> M = 100
    >>> s = 4.0
    >>> w = 2.0
    >>> wavelet = signal.morlet(M, s, w)
    >>> plt.plot(wavelet.real, label="real")
    >>> plt.plot(wavelet.imag, label="imag")
    >>> plt.legend()
    >>> plt.show()

    r
   r   r   r   ç      à¿ç      Ð¿)r(   r)   r*   r+   r,   ÚlinspaceÚpiÚexp)ÚMÚwÚsÚcompletero   Úoutputs         r"   r
   r
   è   s±   € õN „M•$˜‘/Õ#5À!ÐDÑDÔDÐDå
Œ�Q�B˜‘F�RœU‘N A¨¡E­B¬E¡M°1Ñ5Ô5€AÝŒV�B˜‘F˜Q‘JÑÔ€Fàð (Ø•"”&˜  A¡™Ñ'Ô'Ñ'ˆà
�bŒf�T˜Q ™T‘]Ñ#Ô#¥b¤e¨e¡nÑ4Ñ4€Fà€Mr$   c                 ój   — t          j        t          dz  t          d¬¦  «         t	          | |¦  «        S )aŽ  
    Return a Ricker wavelet, also known as the "Mexican hat wavelet".

    .. deprecated:: 1.12.0

        scipy.signal.ricker is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    It models the function:

        ``A * (1 - (x/a)**2) * exp(-0.5*(x/a)**2)``,

    where ``A = 2/(sqrt(3*a)*(pi**0.25))``.

    Parameters
    ----------
    points : int
        Number of points in `vector`.
        Will be centered around 0.
    a : scalar
        Width parameter of the wavelet.

    Returns
    -------
    vector : (N,) ndarray
        Array of length `points` in shape of ricker curve.

    Examples
    --------
    >>> from scipy import signal
    >>> import matplotlib.pyplot as plt

    >>> points = 100
    >>> a = 4.0
    >>> vec2 = signal.ricker(points, a)
    >>> print(len(vec2))
    100
    >>> plt.plot(vec2)
    >>> plt.show()

    r   r   r   )r(   r)   r*   r+   Ú_ricker)ÚpointsÚas     r"   r   r   <  s1   € õT „M•$˜‘/Õ#5À!ÐDÑDÔDÐDÝ�6˜1ÑÔÐr$   c                 ó   — dt          j        d|z  ¦  «        t           j        dz  z  z  }|dz  }t          j        d| ¦  «        | dz
  dz  z
  }|dz  }d||z  z
  }t          j        | d|z  z  ¦  «        }||z  |z  }|S )Nr   r   g      Ð?r   r‚   r   )r,   r-   r‡   r_   rˆ   )	r�   r‘   ÚAÚwsqÚvecÚxsqÚmodÚgaussÚtotals	            r"   r�   r�   j  s�   € Ø	�RŒW�Q˜‘U‰^Œ^�rœu d™{Ñ+Ñ,€AØ
ˆQ‰$€CÝ
Œ)�A�vÑ
Ô
 &¨3¡,°!Ñ!3Ñ
3€CØ
ˆq‰&€CØˆs�S‰y‰=€CÝŒF�C�4˜1˜s™7Ñ#Ñ$Ô$€EØ�‰G�e‰O€EØ€Lr$   é   c                 óR  — t          j        t          dz  t          d¬¦  «         t	          j        d| ¦  «        | dz
  dz  z
  }||z  }t	          j        d|z  |z  ¦  «        t	          j        d|dz  z  ¦  «        z  t          j        dz  z  }t	          j        d	|z  ¦  «        |z  }|S )
aú  
    Complex Morlet wavelet, designed to work with `cwt`.

    .. deprecated:: 1.12.0

        scipy.signal.morlet2 is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    Returns the complete version of morlet wavelet, normalised
    according to `s`::

        exp(1j*w*x/s) * exp(-0.5*(x/s)**2) * pi**(-0.25) * sqrt(1/s)

    Parameters
    ----------
    M : int
        Length of the wavelet.
    s : float
        Width parameter of the wavelet.
    w : float, optional
        Omega0. Default is 5

    Returns
    -------
    morlet : (M,) ndarray

    See Also
    --------
    morlet : Implementation of Morlet wavelet, incompatible with `cwt`

    Notes
    -----

    .. versionadded:: 1.4.0

    This function was designed to work with `cwt`. Because `morlet2`
    returns an array of complex numbers, the `dtype` argument of `cwt`
    should be set to `complex128` for best results.

    Note the difference in implementation with `morlet`.
    The fundamental frequency of this wavelet in Hz is given by::

        f = w*fs / (2*s*np.pi)

    where ``fs`` is the sampling rate and `s` is the wavelet width parameter.
    Similarly we can get the wavelet width parameter at ``f``::

        s = w*fs / (2*f*np.pi)

    Examples
    --------
    >>> import numpy as np
    >>> from scipy import signal
    >>> import matplotlib.pyplot as plt

    >>> M = 100
    >>> s = 4.0
    >>> w = 2.0
    >>> wavelet = signal.morlet2(M, s, w)
    >>> plt.plot(abs(wavelet))
    >>> plt.show()

    This example shows basic use of `morlet2` with `cwt` in time-frequency
    analysis:

    >>> t, dt = np.linspace(0, 1, 200, retstep=True)
    >>> fs = 1/dt
    >>> w = 6.
    >>> sig = np.cos(2*np.pi*(50 + 10*t)*t) + np.sin(40*np.pi*t)
    >>> freq = np.linspace(1, fs/2, 100)
    >>> widths = w*fs / (2*freq*np.pi)
    >>> cwtm = signal.cwt(sig, signal.morlet2, widths, w=w)
    >>> plt.pcolormesh(t, freq, np.abs(cwtm), cmap='viridis', shading='gouraud')
    >>> plt.show()

    r   r   r   r   r‚   r   r„   r…   r   )	r(   r)   r*   r+   r,   r_   rˆ   r‡   r-   )r‰   r‹   rŠ   ro   Úwaveletr�   s         r"   r   r   u  s›   € õZ „M•$˜Ñ"Õ$6À1ÐEÑEÔEÐEå
Œ	�!�Q‰Œ˜1˜s™7 a™-Ñ'€AØ	ˆA‰€AÝŒf�R˜!‘V˜a‘ZÑ Ô ¥2¤6¨$°°A±©+Ñ#6Ô#6Ñ6½¼À¹ÑG€GÝŒW�Q�q‘S‰\Œ\˜GÑ#€FØ€Mr$   c                 ój   — t          j        t          dz  t          d¬¦  «         t	          | |||fi |¤ŽS )aR
  
    Continuous wavelet transform.

    .. deprecated:: 1.12.0

        scipy.signal.cwt is deprecated in SciPy 1.12 and will be removed
        in SciPy 1.15. We recommend using PyWavelets instead.

    Performs a continuous wavelet transform on `data`,
    using the `wavelet` function. A CWT performs a convolution
    with `data` using the `wavelet` function, which is characterized
    by a width parameter and length parameter. The `wavelet` function
    is allowed to be complex.

    Parameters
    ----------
    data : (N,) ndarray
        data on which to perform the transform.
    wavelet : function
        Wavelet function, which should take 2 arguments.
        The first argument is the number of points that the returned vector
        will have (len(wavelet(length,width)) == length).
        The second is a width parameter, defining the size of the wavelet
        (e.g. standard deviation of a gaussian). See `ricker`, which
        satisfies these requirements.
    widths : (M,) sequence
        Widths to use for transform.
    dtype : data-type, optional
        The desired data type of output. Defaults to ``float64`` if the
        output of `wavelet` is real and ``complex128`` if it is complex.

        .. versionadded:: 1.4.0

    kwargs
        Keyword arguments passed to wavelet function.

        .. versionadded:: 1.4.0

    Returns
    -------
    cwt: (M, N) ndarray
        Will have shape of (len(widths), len(data)).

    Notes
    -----

    .. versionadded:: 1.4.0

    For non-symmetric, complex-valued wavelets, the input signal is convolved
    with the time-reversed complex-conjugate of the wavelet data [1].

    ::

        length = min(10 * width[ii], len(data))
        cwt[ii,:] = signal.convolve(data, np.conj(wavelet(length, width[ii],
                                        **kwargs))[::-1], mode='same')

    References
    ----------
    .. [1] S. Mallat, "A Wavelet Tour of Signal Processing (3rd Edition)",
        Academic Press, 2009.

    Examples
    --------
    >>> import numpy as np
    >>> from scipy import signal
    >>> import matplotlib.pyplot as plt
    >>> t = np.linspace(-1, 1, 200, endpoint=False)
    >>> sig  = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2)
    >>> widths = np.arange(1, 31)
    >>> cwtmatr = signal.cwt(sig, signal.ricker, widths)

    .. note:: For cwt matrix plotting it is advisable to flip the y-axis

    >>> cwtmatr_yflip = np.flipud(cwtmatr)
    >>> plt.imshow(cwtmatr_yflip, extent=[-1, 1, 1, 31], cmap='PRGn', aspect='auto',
    ...            vmax=abs(cwtmatr).max(), vmin=-abs(cwtmatr).max())
    >>> plt.show()
    r   r   r   )r(   r)   r*   r+   Ú_cwt)Údatarœ   ÚwidthsrR   Úkwargss        r"   r   r   Ë  s=   € õ` „M•$˜‘,Õ 2¸qÐAÑAÔAÐAÝ��g˜v uÐ7Ð7°Ð7Ð7Ð7r$   c                 óæ  — |€Gt          j         |d|d         fi |¤Ž¦  «        j        j        dv rt           j        }nt           j        }t          j        t          |¦  «        t          | ¦  «        f|¬¦  «        }t          |¦  «        D ]e\  }}t          j	        d|z  t          | ¦  «        g¦  «        }t          j
         |||fi |¤Žd d d…         ¦  «        }	t          | |	d¬¦  «        ||<   Œf|S )	Nr   r   ÚFDGrQ   r   r%   Úsame)Úmode)r,   ÚasarrayrR   ÚcharÚ
complex128Úfloat64r]   rI   Ú	enumerateÚminr0   r   )
rŸ   rœ   r    rR   r¡   r�   rt   ÚwidthrK   Úwavelet_datas
             r"   rž   rž     s÷   € à€}ÝŒ:�g�g˜a ¨¤Ð5Ð5¨fÐ5Ð5Ñ6Ô6Ô<ÔAÀUÐJÐJÝ”MˆEˆEå”JˆEåŒX•s˜6‘{”{¥C¨¡I¤IÐ.°eÐ<Ñ<Ô<€FÝ Ñ'Ô'ð @ð @‰
ˆˆUÝŒF�B˜‘J¥ D¡	¤	Ð*Ñ+Ô+ˆÝ”w˜w˜w q¨%Ð:Ð:°6Ð:Ð:¸4¸4¸R¸4Ô@ÑAÔAˆÝ˜t \¸Ð?Ñ?Ô?ˆˆs‰ˆØ€Mr$   )rM   )r�   r‚   T)rš   )N)r(   Únumpyr,   Úscipy.linalgr   Úscipy.specialr   Úscipy.signalr   Ú__all__r*   r   r   r	   r
   r   r�   r   r   rž   rH   r$   r"   ú<module>r³      s%  ðØ €€€à Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !à
JÐ
JÐ
J€ð€ð
I2ð I2ð I2ðX%ð %ð %ð6nð nð nð nðbQð Qð Qð Qðh+ð +ð +ð\ð ð ðSð Sð Sð SðlQ8ð Q8ð Q8ð Q8ðhð ð ð ð ð r$   