mindspore.ops.BartlettWindow

class mindspore.ops.BartlettWindow(periodic=True, dtype=mstype.float32)[source]

Bartlett window function.

Warning

This is an experimental API that is subject to change or deletion.

Refer to mindspore.ops.bartlett_window() for more details.

Parameters
  • periodic (bool, optional) – If True, returns a window to be used as periodic function. If False, return a symmetric window. Default: True.

  • dtype (mindspore.dtype, optional) – The desired datatype of returned tensor. Only float16, float32 and float64 are allowed. Default: mstype.float32.

Inputs:
  • window_length (Tensor) - The size of returned window, with data type int32, int64. The input data should be an integer with a value of [0, 1000000].

Outputs:

A 1-D tensor of size window_length containing the window. Its datatype is set by the attr dtype.

Supported Platforms:

Ascend GPU CPU

Examples

>>> window_length = Tensor(5, mstype.int32)
>>> bartlett_window = ops.BartlettWindow(periodic=True, dtype=mstype.float32)
>>> output = bartlett_window(window_length)
>>> print(output)
[0.  0.4 0.8 0.8 0.4]