mindspore.numpy.bartlett

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

Returns the Bartlett window. The Bartlett window is very similar to a triangular window, except that the end points are at zero. It is often used in signal processing for tapering a signal, without generating too much ripple in the frequency domain.

参数

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

返回

Tensor, the triangular window, with the maximum value normalized to one (the value one appears only if the number of samples is odd), with the first and last samples equal to zero.

异常

TypeError – If M is not an int.

Supported Platforms:

Ascend GPU CPU

样例

>>> import mindspore.numpy as np
>>> print(np.bartlett(12))
[0.         0.18181819 0.36363637 0.5454545  0.72727275 0.9090909
0.9090909  0.72727275 0.5454545  0.36363637 0.18181819 0.        ]