PyTorch torch.blackman_window function
PyTorch torch reference manual
torch.blackman_window is a function in PyTorch used to generate a Blackman window. The Blackman window is a combination-of-cosines window function with better sidelobe suppression than the Hamming window and is commonly used in spectral analysis.
Function definition
torch.blackman_window(window_length, periodic=True, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Usage examples
Example
import
torch
Create a Blackman window of length 512
window
=
torch.
blackman_window
(
512
)
(
"Blackman window shape:"
,
window.
shape
)
(
"First 5 values of the window:"
,
window
[
:
5
]
)