ó
    Ä
9jò  ã                  ó  • S SK Jr  S SKrS SKrS SKJr  \R
                  " SSSSS9r\R
                  " SS	S
SS9rS rS r	\R
                  " SSSSS9r
S r\R
                  " SSSSS9rS r\R
                  " SS	SSS9rS rg)é    )ÚannotationsN)Ú_corezfloat32 alphazfloat64 outzH
    out = 0.42 - 0.5 * cos(i * alpha) + 0.08 * cos(2 * alpha * i);
    Úcupy_blackman)ÚnamezT arrzY
    if (i < alpha)
        arr = i / alpha;
    else
        arr = 2.0 - i / alpha;
    Úcupy_bartlettc                óø   • U S:X  a#  [         R                  " S[         R                  S9$ U S::  a  [         R                  " / 5      $ U S-
  S-  n[         R                  " U [         R                  S9n[        X5      $ )a€  Returns the Bartlett window.

The Bartlett window is defined as

.. math::
        w(n) = \frac{2}{M-1} \left(
        \frac{M-1}{2} - \left|n - \frac{M-1}{2}\right|
        \right)

Args:
    M (int):
        Number of points in the output window. If zero or less, an empty
        array is returned.

Returns:
    ~cupy.ndarray: Output ndarray.

.. seealso:: :func:`numpy.bartlett`
é   ©Údtyper   ç       @)ÚcupyÚonesÚfloat64ÚarrayÚemptyÚ_bartlett_kernel©ÚMÚalphaÚouts      ÚK/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_math/window.pyÚbartlettr      sa   € ð( 	ˆAƒvÜyŠy˜¤$§,¡,Ñ/Ð/ØˆAƒvÜzŠz˜"‹~ÐØ‰Uc‰M€EÜ
*Š*QœdŸl™lÑ
+€CÜ˜EÓ'Ð'ó    c                ó  • U S:X  a#  [         R                  " S[         R                  S9$ U S::  a  [         R                  " / 5      $ [        R
                  S-  U S-
  -  n[         R                  " U [         R                  S9n[        X5      $ )a§  Returns the Blackman window.

The Blackman window is defined as

.. math::
    w(n) = 0.42 - 0.5 \cos\left(\frac{2\pi{n}}{M-1}\right)
    + 0.08 \cos\left(\frac{4\pi{n}}{M-1}\right)
    \qquad 0 \leq n \leq M-1

Args:
    M (:class:`~int`):
        Number of points in the output window. If zero or less, an empty
        array is returned.

Returns:
    ~cupy.ndarray: Output ndarray.

.. seealso:: :func:`numpy.blackman`
r	   r
   r   é   )r   r   r   r   ÚnumpyÚpir   Ú_blackman_kernelr   s      r   Úblackmanr   8   sj   € ð( 	ˆAƒvÜyŠy˜¤$§,¡,Ñ/Ð/ØˆAƒvÜzŠz˜"‹~ÐÜH‰Hq‰L˜A ™EÑ"€EÜ
*Š*QœdŸl™lÑ
+€CÜ˜EÓ'Ð'r   z-
    out = 0.54 - 0.46 * cos(i * alpha);
    Úcupy_hammingc                ó  • U S:X  a#  [         R                  " S[         R                  S9$ U S::  a  [         R                  " / 5      $ [        R
                  S-  U S-
  -  n[         R                  " U [         R                  S9n[        X5      $ )at  Returns the Hamming window.

The Hamming window is defined as

.. math::
    w(n) = 0.54 - 0.46\cos\left(\frac{2\pi{n}}{M-1}\right)
    \qquad 0 \leq n \leq M-1

Args:
    M (:class:`~int`):
        Number of points in the output window. If zero or less, an empty
        array is returned.

Returns:
    ~cupy.ndarray: Output ndarray.

.. seealso:: :func:`numpy.hamming`
r	   r
   r   r   )r   r   r   r   r   r   r   Ú_hamming_kernelr   s      r   Úhammingr#   ]   ój   € ð& 	ˆAƒvÜyŠy˜¤$§,¡,Ñ/Ð/ØˆAƒvÜzŠz˜"‹~ÐÜH‰Hq‰L˜A ™EÑ"€EÜ
*Š*QœdŸl™lÑ
+€CÜ˜5Ó&Ð&r   z+
    out = 0.5 - 0.5 * cos(i * alpha);
    Úcupy_hanningc                ó  • U S:X  a#  [         R                  " S[         R                  S9$ U S::  a  [         R                  " / 5      $ [        R
                  S-  U S-
  -  n[         R                  " U [         R                  S9n[        X5      $ )ar  Returns the Hanning window.

The Hanning window is defined as

.. math::
    w(n) = 0.5 - 0.5\cos\left(\frac{2\pi{n}}{M-1}\right)
    \qquad 0 \leq n \leq M-1

Args:
    M (:class:`~int`):
        Number of points in the output window. If zero or less, an empty
        array is returned.

Returns:
    ~cupy.ndarray: Output ndarray.

.. seealso:: :func:`numpy.hanning`
r	   r
   r   r   )r   r   r   r   r   r   r   Ú_hanning_kernelr   s      r   Úhanningr(      r$   r   zfloat32 beta, float32 alphaz„
    float temp = (i - alpha) / alpha;
    arr = cyl_bessel_i0(beta * sqrt(1 - (temp * temp)));
    arr /= cyl_bessel_i0(beta);
    Úcupy_kaiserc                óâ   • U S:X  a  [         R                  " S/5      $ U S::  a  [         R                  " / 5      $ U S-
  S-  n[         R                  " U [         R                  S9n[	        XU5      $ )a   Return the Kaiser window.
The Kaiser window is a taper formed by using a Bessel function.

.. math::  w(n) = I_0\left( \beta \sqrt{1-\frac{4n^2}{(M-1)^2}}
           \right)/I_0(\beta)

with

.. math:: \quad -\frac{M-1}{2} \leq n \leq \frac{M-1}{2}

where :math:`I_0` is the modified zeroth-order Bessel function.

 Args:
    M (int):
        Number of points in the output window. If zero or less, an empty
        array is returned.
    beta (float):
        Shape parameter for window

Returns:
    ~cupy.ndarray:  The window, with the maximum value normalized to one
    (the value one appears only if the number of samples is odd).

.. seealso:: :func:`numpy.kaiser`
r	   g      ð?r   r   r
   )r   r   r   r   Ú_kaiser_kernel)r   Úbetar   r   s       r   Úkaiserr-   §   s_   € ð4 	ˆAƒvÜzŠz˜2˜$ÓÐØˆAƒvÜzŠz˜"‹~ÐØ‰Uc‰M€EÜ
*Š*QœdŸl™lÑ
+€CÜ˜$ sÓ+Ð+r   )Ú
__future__r   r   r   r   ÚElementwiseKernelr   r   r   r   r"   r#   r'   r(   r+   r-   © r   r   Ú<module>r1      sÎ   ðÝ "ã ã Ý à×*Ò*ØØðàñÐ ð ×*Ò*ØØðð
 ñÐ ò(ò:(ð: ×)Ò)ØØðàñ€ò'ð8 ×)Ò)ØØðàñ€ò'ð8 ×(Ò(Ø!Øðð ñ€ó ,r   