torch.kaiser_window#
- torch.kaiser_window(window_length, periodic=True, beta=12.0, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) Tensor #
Computes the Kaiser window with window length
window_length
and shape parameterbeta
.Let I_0 be the zeroth order modified Bessel function of the first kind (see
torch.i0()
) andN = L - 1
ifperiodic
is False andL
ifperiodic
is True, whereL
is thewindow_length
. This function computes调用
torch.kaiser_window(L, B, periodic=True)
等价于调用torch.kaiser_window(L + 1, B, periodic=False)[:-1])
。periodic
参数旨在作为一种便捷的速记方法,用于为torch.stft()
等函数提供周期性窗口作为输入。注意
如果
window_length
为一,则返回的窗口是包含一的单个元素张量。- 参数
- 关键字参数
dtype (
torch.dtype
, optional) – 返回张量的所需数据类型。默认值:如果None
,则使用全局默认值(请参阅torch.set_default_dtype()
)。layout (
torch.layout
, optional) – 返回窗口张量的所需布局。仅支持torch.strided
(密集布局)。device (
torch.device
, optional) – 返回张量的所需设备。默认值:如果None
,则使用当前设备作为默认张量类型(请参阅torch.set_default_device()
)。对于 CPU 张量类型,device
将是 CPU;对于 CUDA 张量类型,它将是当前 CUDA 设备。requires_grad (bool, optional) – 是否应为返回的张量记录自动微分操作。默认值:
False
。