PyTorch torch.bartlett_window function
PyTorch torch reference manual
torch.bartlett_window is a function in PyTorch used to generate a Bartlett window. The Bartlett window is a triangular window function commonly used 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 examples
Example
import
torch
Create a Bartlett window of length 512
window
=
torch.
bartlett_window
(
512
)
(
"Bartlett window shape:"
,
window.
shape
)
(
"First 5 values of the window:"
,
window
[
:
5
]
)