Rate this Page

torch.kaiser_window#

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

Computes the Kaiser window with window lengthwindow_length and shape parameterbeta.

Let I_0 be the zeroth order modified Bessel function of the first kind (seetorch.i0()) andN=L-1 ifperiodic is False andL ifperiodic is True,whereL is thewindow_length. This function computes:

outi=I0(β1(iN/2N/2)2)/I0(β)out_i = I_0 \left( \beta \sqrt{1 - \left( {\frac{i - N/2}{N/2}} \right) ^2 } \right) / I_0( \beta )

Callingtorch.kaiser_window(L,B,periodic=True) is equivalent to callingtorch.kaiser_window(L+1,B,periodic=False)[:-1]).Theperiodic argument is intended as a helpful shorthandto produce a periodic window as input to functions liketorch.stft().

Note

Ifwindow_length is one, then the returned window is a single element tensor containing a one.

Parameters
  • window_length (int) – length of the window.

  • periodic (bool,optional) – If True, returns a periodic window suitable for use in spectral analysis.If False, returns a symmetric window suitable for use in filter design.

  • beta (float,optional) – shape parameter for the window.

Keyword Arguments
  • dtype (torch.dtype, optional) – the desired data type of returned tensor.Default: ifNone, uses a global default (seetorch.set_default_dtype()).

  • layout (torch.layout, optional) – the desired layout of returned window tensor. Onlytorch.strided (dense layout) is supported.

  • device (torch.device, optional) – the desired device of returned tensor.Default: ifNone, uses the current device for the default tensor type(seetorch.set_default_device()).device will be the CPUfor CPU tensor types and the current CUDA device for CUDA tensor types.

  • requires_grad (bool,optional) – If autograd should record operations on thereturned tensor. Default:False.