mindspore.ops.bartlett_window
- mindspore.ops.bartlett_window(window_length, periodic=True, *, dtype=None)[source]
Bartlett window function.
A triangular-shaped weighting function used for smoothing or frequency analysis of signals in digital signal processing.
where
is the full window size, and n is natural number less than :[0, 1, …, N-1].- Parameters
- 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 >>> window_length = mindspore.tensor(5) >>> output = mindspore.ops.bartlett_window(window_length) >>> print(output) [0. 0.4 0.8 0.8 0.4] >>> output = mindspore.ops.bartlett_window(window_length, periodic=False) >>> print(output) [0. 0.5 1. 0.5 0. ]