mindspore.ops.hann_window
- mindspore.ops.hann_window(window_length, periodic=True, *, dtype=None)[源代码]
汉宁窗口函数。
- 参数:
window_length (int) - 窗口的大小。
periodic (bool, 可选) - 如果为
True
,表示返回周期窗口。如果为False
,表示返回对称窗口。默认True
。
- 关键字参数:
dtype (mindspore.dtype, 可选) - 指定数据类型。默认
None
。
- 返回:
一维tensor。
- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> output = mindspore.ops.hann_window(5) >>> print(output) [0. 0.3454915 0.9045085 0.9045085 0.3454915] >>> output = mindspore.ops.hann_window(5, periodic=False) >>> print(output) [0.08000001 0.54 1. 0.54 0.08000001]