mindspore.ops.hann_window

View Source On Gitee
mindspore.ops.hann_window(window_length, periodic=True, *, dtype=None)[source]

Hann window function.

w(n)=1212cos(2πnM1),0nM1
Parameters
  • window_length (int) – The size of window.

  • periodic (bool, optional) – If True , return a periodic window. If False, return a symmetric window. Default True .

Keyword Arguments

dtype (mindspore.dtype, optional) – The data type specified. Default None .

Returns

A 1-D tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> output = mindspore.ops.hann_window(5)
>>> print(output)
[0.        0.3454915 0.9045085 0.9045085 0.3454915]
>>> output = mindspore.ops.hann_window(5, periodic=False)
>>> print(output)
[0.  0.5 1.  0.5 0. ]