mindspore.numpy.hamming

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

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

参数

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

返回

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

异常

TypeError – If M is not an int.

Supported Platforms:

Ascend GPU CPU

样例

>>> import mindspore.numpy as np
>>> print(np.hamming(12))
[0.08000001 0.15302339 0.34890914 0.6054648  0.841236   0.9813669
0.9813668  0.8412359  0.6054647  0.34890908 0.15302327 0.08000001]