mindspore.ops.hamming_window
- mindspore.ops.hamming_window(window_length, periodic=True, alpha=0.54, beta=0.46, *, dtype=None)[source]
Hamming window function.
\[w[n]=\alpha − \beta \cos \left( \frac{2 \pi n}{N - 1} \right),\]where \(N\) is the full window size, and n is natural number less than \(N\) :[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 >>> output = mindspore.ops.hamming_window(5) >>> print(output) [0.08000001 0.3978522 0.9121478 0.9121478 0.3978522 ] >>> output = mindspore.ops.hamming_window(5, periodic=False) >>> print(output) [0.08000001 0.54 1. 0.54 0.08000001]