TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

tensorplay.signal.windows.kaiser

tensorplay.signal.windows.kaiser(M: int, *, beta: float = 12.0, sym: bool = True, dtype: dtype | None = None, layout: Layout = tensorplay.strided, device: device | None = None, requires_grad: bool = False) → Tensor[source]

Computes the Kaiser window.

The samples are

wn=I0(β1−(n−N/2N/2)2)/I0(β)w_n = I_0 \left( \beta \sqrt{1 - \left( {\frac{n - N/2}{N/2}} \right) ^2 } \right) / I_0( \beta )

where I0I_0 is the modified Bessel function of the first kind of order zero, evaluated with tensorplay.i0(), and N=M−1N = M - 1 for a symmetric window, otherwise N=MN = M.

The window is scaled so that its largest value is 1. The value 1 itself does not occur when M is even and sym is True.

Parameters:

M (int) – number of points of the returned window.

Keyword Arguments:
  • beta (float, optional) – shape parameter of the window. Must be non-negative. Default: 12.0

  • sym (bool, optional) – if False, returns a periodic window, which is the usual choice for spectral analysis. If True, returns a symmetric window, which is the usual choice for filter design. Default: True.

  • dtype (tensorplay.dtype, optional) – the desired data type of the returned tensor. Default: if None, uses the global default (see tensorplay.set_default_dtype()).

  • layout (tensorplay.Layout, optional) – the desired layout of the returned tensor. Default: tensorplay.strided.

  • device (tensorplay.device, optional) – the desired device of the returned tensor. Default: if None, uses the current default tensor device (see tensorplay.set_default_device()).

  • requires_grad (bool, optional) – whether autograd should record operations on the returned tensor. Default: False.

Examples:

>>> # Symmetric Kaiser window of length 5 with shape parameter 12.0.
>>> tensorplay.signal.windows.kaiser(5)
tensor([0.0001, 0.2157, 1., 0.2157, 0.0001])

>>> # Periodic Kaiser window of length 5 with shape parameter 0.9.
>>> tensorplay.signal.windows.kaiser(5, sym=False, beta=0.9)
tensor([0.8244, 0.9348, 0.9926, 0.9926, 0.9348])

On this page

Ask DeepWiki