U
    q±ËhÁ  ã                   @  s4   d dl mZ d dlZd dlmZ G dd„ deƒZdS )é    )ÚannotationsN)Ú_CommonWindowc                   @  s   e Zd ZdZddd„ZdS )ÚBlackmanWindowa3  Blankman windowing function.

    Returns :math:`\\omega_n = 0.42 - 0.5 \\cos \\left( \\frac{2\\pi n}{N-1} \\right) + 0.08 \\cos \\left( \\frac{4\\pi n}{N-1} \\right)`
    where *N* is the window length.

    See `blackman_window <https://pytorch.org/docs/stable/generated/torch.blackman_window.html>`_
    Nc           
      C  s|   t  |¡| }}|dkr |d }d}d}t j}t  ||d  | ¡d }	|	t  ||d  | ¡| 7 }	|	|7 }	|  ||	|¡S )Nr   é   gáz®GáÚ?g{®Gáz´?é   g      à¿é   )ÚnpZarangeÚpiÚcosZ_end)
ÚselfÚsizeZoutput_datatypeZperiodicÚniZN_1ÚalphaÚbetar	   Úy© r   úI/tmp/pip-unpacked-wheel-xnis5xre/onnx/reference/ops/op_blackman_window.pyÚ_run   s    zBlackmanWindow._run)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r      s   r   )Ú
__future__r   Znumpyr   Z$onnx.reference.ops._op_common_windowr   r   r   r   r   r   Ú<module>   s   