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

PyTorch torch.kaiser_window function

PyTorch torch.kaiser_window function


PyTorch torch reference manual PyTorch torch reference manual

torch.kaiser_window is a function in PyTorch used to generate a Kaiser window. The Kaiser window is an adjustable window function constructed from Bessel functions, and its parameters control the trade-off between main-lobe width and side-lobe attenuation.

Function definition

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


Usage examples

Example

import

torch

Create a Kaiser window of length 512 with the default beta=12.0

window

=

torch.

kaiser_window

(

512

)

print

(

"Kaiser window shape:"

,

window.

shape

)

print

(

"First 5 values of the window:"

,

window

[

:

5

]

)

Custom beta parameter (the larger beta is, the lower the side lobes and the wider the main lobe)

window2

=

torch.

kaiser_window

(

512

,

beta

=

8.0

)

window3

=

torch.

kaiser_window

(

512

,

beta

=

16.0

)

print

(

"First 3 values of the beta=8.0 window:"

,

window2

[

:

3

]

)

print

(

"First 3 values of the beta=16.0 window:"

,

window3

[

:

3

]

)


PyTorch torch reference manual PyTorch torch reference manual