MCPcopy Index your code
hub / github.com/numpy/numpy / kaiser

Function kaiser

numpy/lib/_function_base_impl.py:3608–3735  ·  view source on GitHub ↗

Return the Kaiser window. The Kaiser window is a taper formed by using a Bessel function. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. beta : float Shape parameter for window.

(M, beta)

Source from the content-addressed store, hash-verified

3606
3607@set_module('numpy')
3608def kaiser(M, beta):
3609 """
3610 Return the Kaiser window.
3611
3612 The Kaiser window is a taper formed by using a Bessel function.
3613
3614 Parameters
3615 ----------
3616 M : int
3617 Number of points in the output window. If zero or less, an
3618 empty array is returned.
3619 beta : float
3620 Shape parameter for window.
3621
3622 Returns
3623 -------
3624 out : array
3625 The window, with the maximum value normalized to one (the value
3626 one appears only if the number of samples is odd).
3627
3628 See Also
3629 --------
3630 bartlett, blackman, hamming, hanning
3631
3632 Notes
3633 -----
3634 The Kaiser window is defined as
3635
3636 .. math:: w(n) = I_0\\left( \\beta \\sqrt{1-\\frac{4n^2}{(M-1)^2}}
3637 \\right)/I_0(\\beta)
3638
3639 with
3640
3641 .. math:: \\quad -\\frac{M-1}{2} \\leq n \\leq \\frac{M-1}{2},
3642
3643 where :math:`I_0` is the modified zeroth-order Bessel function.
3644
3645 The Kaiser was named for Jim Kaiser, who discovered a simple
3646 approximation to the DPSS window based on Bessel functions. The Kaiser
3647 window is a very good approximation to the Digital Prolate Spheroidal
3648 Sequence, or Slepian window, which is the transform which maximizes the
3649 energy in the main lobe of the window relative to total energy.
3650
3651 The Kaiser can approximate many other windows by varying the beta
3652 parameter.
3653
3654 ==== =======================
3655 beta Window shape
3656 ==== =======================
3657 0 Rectangular
3658 5 Similar to a Hamming
3659 6 Similar to a Hanning
3660 8.6 Similar to a Blackman
3661 ==== =======================
3662
3663 A beta value of 14 is probably a good starting point. Note that as beta
3664 gets large, the window narrows, and so the number of samples needs to be
3665 large enough to sample the increasingly narrow spike, otherwise NaNs will

Callers 3

test_kaiserMethod · 0.90
test_simpleMethod · 0.90
test_int_betaMethod · 0.90

Calls 2

i0Function · 0.85
sqrtFunction · 0.85

Tested by 3

test_kaiserMethod · 0.72
test_simpleMethod · 0.72
test_int_betaMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…