mindspore.ops.bartlett_window
- mindspore.ops.bartlett_window(window_length, periodic=True, *, dtype=None)[源代码]
巴特利特窗口函数。
是一种三角形状的加权函数,通常用于平滑处理或频域分析信号。
其中,
是总的窗口长度 window_length ,n为小于 的自然数 [0, 1, …, N-1]。- 参数:
window_length (Tensor) - 窗口的大小。
periodic (bool,可选) - 如果为
True
,表示返回周期窗口。如果为False
,表示返回对称窗口。默认True
。
- 关键字参数:
dtype (mindspore.dtype,可选) - 指定数据类型。默认
None
。
- 返回:
一维tensor。
- 支持平台:
Ascend
GPU
CPU
样例:
>>> 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. ]