PyTorch torch.kaiser_window Function


Pytorch torch 参考手册PyTorch torch Reference Manual

torch.kaiser_windowIt is a function in PyTorch used to generate Kaiser windows. The Kaiser window is an adjustable window function constructed using Bessel functions, and the trade-off between main lobe width and side lobe attenuation can be controlled via parameters.

Function Definition

torch.kaiser_window(window_length, periodic=True, beta=12.0, dtype=None, layout=torch.strided, device=None, requires_grad=False)

Usage Example

Example

import torch

# Create a Kaiser window of length 512, default beta=12.0
window = torch.kaiser_window(512)
print("Kaiser window shape:", window.shape)
print("First 5 values of the window:", window[:5])

# Customize the beta parameter (larger beta means lower side lobes and wider main lobe)
window2 = torch.kaiser_window(512, beta=8.0)
window3 = torch.kaiser_window(512, beta=16.0)
print("First 3 values of the window with beta=8.0:", window2[:3])
print("First 3 values of the window with beta=16.0:", window3[:3])

Pytorch torch 参考手册PyTorch torch Reference Manual

Other Extensions