torch.hamming_window¶
- torch.hamming_window(window_length, periodic=True, alpha=0.54, beta=0.46, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) Tensor¶
Hamming 窗函式。
其中 是完整的窗大小。
輸入
window_length是一個正整數,控制返回的窗大小。periodic標誌決定了返回的窗是否從對稱窗中移除最後一個重複值,以便與torch.stft()等函式一起用作週期性窗。因此,如果periodic為 True,則上述公式中的 實際上是 。此外,torch.hamming_window(L, periodic=True)總是等於torch.hamming_window(L + 1, periodic=False)[:-1])。注意
如果
window_length,返回的窗只包含一個值 1。注意
這是
torch.hann_window()的通用版本。- 引數
- 關鍵字引數
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) – 如果 autograd 應該記錄返回張量上的操作。預設值:
False。
- 返回
一個大小為 的 1-D 張量,包含窗函式的值。
- 返回型別