mindspore.ops.kaiser_window

mindspore.ops.kaiser_window(window_length, periodic=True, beta=12.0, *, dtype=None)[source]

Generates a Kaiser window, which is also known as the Kaiser-Bessel window.

The Kaiser window is defined as

\[w(n) = \frac{I_{0}\left( \beta\sqrt{1 - \frac{4n^{2}}{(M - 1)^{2}}} \right)}{I_{0}(\beta)}\]

with

\[- \frac{M - 1}{2} \leq n \leq \frac{M - 1}{2}\]

where \(I_0\) is the modified zeroth-order Bessel function.

Parameters
  • window_length (int) – Length of window.

  • periodic (bool, optional) – When set to True, generates a periodic window for spectral analysis. When set to False, generates a symmetric window for filter design. Default: True.

  • beta (float, optional) – Shape parameter, when beta gets large, the window narrows. Default: 12.0.

Keyword Arguments

dtype (mindspore.dtype, optional) – The output window data type, it must be float. Default: None.

Returns

Tensor, a Kaiser window.

Raises
  • TypeError – If window_length or beta is not an integer.

  • TypeError – If periodic is not a variable of Boolean type.

  • ValueError – If window_length is negative.

Supported Platforms:

Ascend GPU CPU

Examples

>>> window_length = 5
>>> out = ops.kaiser_window(window_length)
>>> print(out.asnumpy())
[5.27734413e-05 1.01719688e-01 7.92939834e-01 7.92939834e-01
 1.01719688e-01]