mindspore.numpy.hanning

mindspore.numpy.hanning(M)[源代码]

Returns the Hanning window. The Hanning window is a taper formed by using a weighted cosine.

Parameters

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

Returns

Tensor, the window, with the maximum value normalized to one (the value one appears only if the number of samples is odd).

Raises

TypeError – If M is not an int.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore.numpy as np
>>> print(np.hanning(12))
[0.         0.07937324 0.29229254 0.5711574  0.8274304  0.9797465
0.97974646 0.82743025 0.5711573  0.29229245 0.07937312 0.        ]