PyTorch torch.bartlett_window Function


Pytorch torch 参考手册Pytorch torch Reference Manual

torch.bartlett_windowis a function in PyTorch used to generate the Bartlett window. The Bartlett window is a triangular window function, commonly used as a window function in signal processing to reduce spectral leakage.

Function Definition

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

Usage Example

Example

import torch

# Create a Bartlett window of length 512
window = torch.bartlett_window(512)
print("Bartlett window shape:", window.shape)
print("First 5 values of the window:", window[:5])

Pytorch torch 参考手册Pytorch torch Reference Manual

Other Extensions