+
    [°³j|#  ã                   óp   € ^ RI HtHt ^RIHtHtHtHt ^RIH	t	H
t
 ^RIHt R.t^ RItR tR
R^/R	 lltR# )é    )ÚceilÚfloor)ÚContinuousWaveletÚDiscreteContinuousWaveletÚWaveletÚ_check_dtype)Úintegrate_waveletÚscale2frequency)Ú	AxisErrorÚcwtNc                óN   € ^\        \        P                  ! V 4      4      ,          # )z¡Round up size to the nearest power of two.

Given a number of samples `n`, returns the next power of two
following this number to take advantage of FFT speedup.
)r   ÚnpÚlog2)Úns   &ÚJ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/pywt/_cwt.pyÚnext_fast_lenr      s   € ð Œd”2—7’7˜1“:ÓÕÐó    Ú	precisionc               óü  € \        V 4      p\        P                  ! WR7      p \        P                  ! V\        P                  4      p\        V\        \        34      '       g   \        V4      p\        V\        4      '       g   \        RVP                  : R24      h\        P                  ! V4      p\        P                  ! V^ 8*  4      '       d   \        R4      h\        P                  ! V4      '       g   \        R4      hVP                  '       d   TMTp	\        P                   ! \        P"                  ! V4      3V P$                  ,           V	R7      p
\'        W&R7      w  r¼VP                  '       d   \        P(                  ! V4      MTpVP*                  P,                  R8X  d   TMTp\        P                  ! W½R7      p\        P                  ! WÀP.                  P*                  R7      pVR8X  d@   RpR	pV P*                  P,                  R8g  ;'       d    VP*                  P,                  R8g  pMVR
8w  d   \        R4      hV P0                  ^8”  dC   V P3                  RV4      p V P$                  pV P5                  RV P$                  R,          34      p \7        V4       EF  w  ppV^,          V^ ,          ,
          p\        P8                  ! VVR,          V^ ,          ,
          ,          ^,           4      VV,          ,          pVP;                  \<        4      pVR,          VP"                  8¼  d%   \        P>                  ! VVP"                  8  V4      pVV,          R	R	R1,          pVR
8X  dÑ   V P0                  ^8X  d   \        P@                  ! V V4      pEM\C        V P$                  4      pVR;;,          VP"                  ^,
          ,          uu&   \E        V4      p\        P                   ! VV	R7      p\G        V P$                  ^ ,          4       F&  p\        P@                  ! V V,          V4      VVR3&   K(  	  EM^\I        V P$                  R,          VP"                  ,           ^,
          4      pVX8w  dN   X'       d$   \        PJ                  PM                  V VRR7      pM"\        PJ                  PK                  V VRR7      pTpX'       dM   \        PJ                  PM                  VVRR7      p\        PJ                  PO                  VX,          VRR7      pMJ\        PJ                  PK                  VVRR7      p\        PJ                  PQ                  VX,          RR7      pVRR	V P$                  R,          VP"                  ,           ^,
          13,          p\        PR                  ! V4      ) \        PT                  ! VRR7      ,          pV
P*                  P,                  R8w  d   VP.                  pVP$                  R,          V P$                  R,          ,
          R,          pV^ 8”  d"   VR\W        V4      \Y        V4      ) 13,          pMV^ 8  d   \        RV R24      hV P0                  ^8”  d$   VP5                  X4      pVP3                  VR4      pVV
VR3&   EK  	  \[        W!V4      p\        P                  ! V4      '       d   \        P\                  ! V.4      pVV,          pV
V3# )a  
One dimensional Continuous Wavelet Transform.

Parameters
----------
data : array_like
    Input signal
scales : array_like
    The wavelet scales to use. One can use
    ``f = scale2frequency(wavelet, scale)/sampling_period`` to determine
    what physical frequency, ``f``. Here, ``f`` is in hertz when the
    ``sampling_period`` is given in seconds.
wavelet : Wavelet object or name
    Wavelet to use
sampling_period : float
    Sampling period for the frequencies output (optional).
    The values computed for ``coefs`` are independent of the choice of
    ``sampling_period`` (i.e. ``scales`` is not scaled by the sampling
    period).
method : {'conv', 'fft'}, optional
    The method used to compute the CWT. Can be any of:
        - ``conv`` uses ``numpy.convolve``.
        - ``fft`` uses frequency domain convolution.
        - ``auto`` uses automatic selection based on an estimate of the
          computational complexity at each scale.

    The ``conv`` method complexity is ``O(len(scale) * len(data))``.
    The ``fft`` method is ``O(N * log2(N))`` with
    ``N = len(scale) + len(data) - 1``. It is well suited for large size
    signals but slightly slower than ``conv`` on small ones.
axis: int, optional
    Axis over which to compute the CWT. If not given, the last axis is
    used.
precision: int, optional
    Length of wavelet (``2 ** precision``) used to compute the CWT. Greater
    will increase resolution, especially for higher scales, but will
    compute a bit slower. Too low will distort coefficients and their
    norms, with a zipper-like effect. The default is 12, it's recommended
    to use >=12.

Returns
-------
coefs : array_like
    Continuous wavelet transform of the input signal for the given scales
    and wavelet. The first axis of ``coefs`` corresponds to the scales.
    The remaining axes match the shape of ``data``.
frequencies : array_like
    If the unit of sampling period are seconds and given, then frequencies
    are in hertz. Otherwise, a sampling period of 1 is assumed.

Notes
-----
Size of coefficients arrays depends on the length of the input array and
the length of given scales.

The transform is computed entirely in units of samples. With the scale
``a`` and the translation ``b`` both expressed in samples, the returned
coefficients are::

    C[a, b] = 1/sqrt(a) * sum_n data[n] * conj(psi((n - b)/a))

No sampling interval enters this expression, which is why ``coefs`` does
not depend on ``sampling_period``. To express the coefficients in
physical-time units instead, multiply them by ``sqrt(dt)`` (equivalently,
divide by ``sqrt(fs)``); that factor comes from approximating the integral
of the continuous-time transform by a Riemann sum. See the
:ref:`CWT normalization` section of the documentation for details.

Examples
--------
>>> import pywt
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> x = np.exp(np.linspace(0, 2, 512))
>>> y = np.cos(2*np.pi*x)  # exponential chirp
>>> scales = np.logspace(np.log10(1), np.log10(128), 128)
>>> coef, freqs = pywt.cwt(y, scales, 'gaus1')
>>> plt.matshow(coef)
>>> plt.show()

>>> import pywt
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> t = np.linspace(-1, 1, 200, endpoint=False)
>>> sig  = np.cos(2 * np.pi * 7 * t) + np.real(np.exp(-7*(t-0.4)**2)*np.exp(1j*2*np.pi*2*(t-0.4)))
>>> widths = np.logspace(np.log10(1), np.log10(30), 30)
>>> cwtmatr, freqs = pywt.cwt(sig, widths, 'mexh')
>>> plt.imshow(cwtmatr, extent=[-1, 1, 1, 31], cmap='PRGn', aspect='auto',
...            vmax=abs(cwtmatr).max(), vmin=-abs(cwtmatr).max())
>>> plt.show()
)Údtypez)cwt() requires a continuous wavelet, but zŠ is a discrete wavelet. Use a continuous wavelet such as those returned by pywt.wavelist(kind='continuous') (e.g. 'morl', 'mexh', 'cmor').z*`scales` must only include positive valueszaxis must be a scalar.)r   ÚcÚfftNÚconvzmethod must be 'conv' or 'fft':NNN)Úaxis)r   r   .g       @zSelected scale of z too small.éÿÿÿÿ)/r   r   ÚasarrayÚresult_typeÚ	complex64Ú
isinstancer   r   r   Ú
ValueErrorÚnameÚ
atleast_1dÚanyÚisscalarr   Úcomplex_cwtÚemptyÚsizeÚshaper	   Úconjr   ÚkindÚrealÚndimÚswapaxesÚreshapeÚ	enumerateÚarangeÚastypeÚintÚextractÚconvolveÚlistÚtupleÚranger   r   ÚrfftÚirfftÚifftÚsqrtÚdiffr   r   r
   Úarray)ÚdataÚscalesÚwaveletÚsampling_periodÚmethodr   r   ÚdtÚdt_cplxÚdt_outÚoutÚint_psiÚxÚdt_psiÚsize_scale0Úfft_dataÚuse_real_fftÚdata_shape_preÚiÚscaleÚstepÚjÚint_psi_scaler   Ú
conv_shaper   Ú
size_scaleÚfft_wavÚcoefÚdÚfrequenciess   &&&&&&$                        r   r   r      sH  € ô~ 
�dÓ	€BÜ�:Š:�dÔ%€DÜ�nŠn˜R¤§¡Ó.€GÜ�gÔ 1´7Ð;×<Ò<Ü+¨GÓ4ˆÜ�gÔ0×1Ò1ÜØ7¸¿¹Ñ7Gð HQð Ró
ð 	
ô �]Š]˜6Ó"€FÜ	‡v‚vˆf˜‰k×ÒÜÐEÓFÐFä�;Š;�t×ÒÜÐ0Ó1Ð1à×+×+Ð+‰W°€FÜ
�(Š(”B—G’G˜F“OÐ%¨¯
©
Õ2¸&Ô
A€Cä" 7Ô@�J€GØ")×"5×"5Ð"5Œb�gŠg�gÔ¸7€Gð  Ÿ™×*Ñ*¨cÔ1‰W°r€FÜ�jŠj˜Ô/€GÜ
�
Š
�1ŸI™IŸO™OÔ,€Aà�„ØˆØˆØ—z‘z—‘¨#Ñ-×KÐK°'·-±-×2DÑ2DÈÑ2K‰Ø	�6Ô	ÜÐ9Ó:Ð:à‡y�y�1„}à�}‰}˜R Ó&ˆð Ÿ™ˆØ�|‰|˜R §¡¨B¥Ð0Ó1ˆä˜f×%‰ˆˆ5Ø��t�a˜•d�{ˆÜ�IŠI�e˜q �u q¨¥t�|Õ,¨qÕ0Ó1°U¸Tµ\ÕBˆØ�H‰H”S‹MˆØˆR�5�G—L‘LÔ Ü—
’
˜1˜wŸ|™|Ñ+¨QÓ/ˆAØ �
¡4 R 4Õ(ˆà�VÔØ�y‰y˜AŒ~Ü—{’{ 4¨Ó7’ô " $§*¡*Ó-�
Ø˜2— -×"4Ñ"4°qÕ"8Õ8“Ü" :Ó.�
Ü—x’x 
°&Ô9�Ü˜tŸz™z¨!�}Ö-�AÜ!#§¢¨T°!­W°mÓ!D�D˜˜A˜“Jó .ô 'Ø—
‘
˜2• ×!3Ñ!3Õ3°aÕ7óˆJð ˜[Ô(çÜ!Ÿv™vŸ{™{¨4°À"˜{ÓE‘Hä!Ÿv™vŸz™z¨$°
À˜zÓD�HØ$ˆKßÜŸ&™&Ÿ+™+ m°ZÀb˜+ÓI�Ü—v‘v—|‘|Ø˜hÕ&¨*¸2ð $ó ‘ô Ÿ&™&Ÿ*™* ]°JÀR˜*ÓH�Ü—v‘v—{‘{ 7¨XÕ#5¸B�{Ó?�Ø˜ÐE˜dŸj™j¨�n¨}×/AÑ/AÕAÀAÕEÐEÐEÕFˆDä—’˜“Ð¤"§'¢'¨$°RÔ"8Õ8ˆØ�9‰9�>‰>˜SÔ Ø—9‘9ˆDà�Z‰Z˜�^˜dŸj™j¨�nÕ,°Õ2ˆØˆqŒ5Ø˜œU 1›X¤t¨A£w hÐ.Ð.Õ/‰DØ�ŒUÜØ$ U G¨;Ð7ó9ð 9à�9‰9�qŒ=à—<‘< Ó/ˆDØ—=‘=  rÓ*ˆDØˆˆAˆsˆFŒñu &ôx " '°9Ó=€KÜ	‡{‚{�;×ÒÜ—h’h ˜}Ó-ˆØ�?Õ"€KØ�ÐÐr   )g      ð?r   r   )Úmathr   r   Ú_extensions._pywtr   r   r   r   Ú
_functionsr	   r
   Ú_utilsr   Ú__all__Únumpyr   r   r   © r   r   Ú<module>r`      s:   ðß ÷ó ÷ ;Ý àˆ'€ó òñLØ÷Lr   