mindspore/docs/api/api_python/ops/mindspore.ops.HammingWindow...

38 lines
2.0 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.HammingWindow
===========================
.. py:class:: mindspore.ops.HammingWindow(periodic=True, alpha=0.54, beta=0.46, dtype=mstype.float32)
使用输入窗口长度计算汉明窗口函数。
.. math::
w[n] = \alpha - \beta\ \cos \left( \frac{2 \pi n}{N - 1} \right),
其中, :math:`N` 是全窗口尺寸。
参数:
- **periodic** (bool可选) - 一个标志表示返回的窗口是否修剪掉来自对称窗口的最后一个重复值。默认值True。
- 如果为True则返回的窗口作为周期函数在上式中 :math:`N = text{length} + 1`
- 如果为False则返回一个对称窗口 :math:`N = text{length}`
- **alpha** (float可选) - 加权系数,上式中的 :math:`\alpha` 默认值0.54。
- **beta** (float可选) - 加权系数,上式中的 :math:`\beta` 默认值0.46。
- **dtype** (:class:`mindspore.dtype`,可选) - 数据类型,可选值为 `mindspore.dtype.float16``mindspore.dtype.float32``mindspore.dtype.float64` 。默认值: `mindspore.dtype.float32`
输入:
- **length** (Tensor) - 一个1D的正整数Tensor控制返回窗口的大小。
输出:
Tensor一个包含窗口的1-D Tensor其shape为 :math:`\text{length}`
异常:
- **TypeError** - 如果 `length` 不是一个Tensor。
- **TypeError** - 如果 `length` 的数据类型不是整型。
- **TypeError** - 如果 `periodic` 的数据类型不是bool类型。
- **TypeError** - 如果 `alpha` 的数据类型不是float类型。
- **TypeError** - 如果 `beta` 的数据类型不是float类型。
- **TypeError** - 如果 `dtype` 的取值不是 `mindspore.float16``mindspore.float32``mindspore.float64`
- **ValueError** - 如果 `length` 的维度不是1。
- **ValueError** - 如果 `length` 的值是负数。