Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.blackman_window function

PyTorch torch.blackman_window function


PyTorch torch reference manual 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

)

print

(

"Blackman window shape:"

,

window.

shape

)

print

(

"First 5 values of the window:"

,

window

[

:

5

]

)


PyTorch torch reference manual PyTorch torch reference manual