MCPcopy Create free account
hub / github.com/numpy/numpy / kaiser

Function kaiser

numpy/lib/function_base.py:3493–3625  ·  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

3491
3492@set_module('numpy')
3493def kaiser(M, beta):
3494 """
3495 Return the Kaiser window.
3496
3497 The Kaiser window is a taper formed by using a Bessel function.
3498
3499 Parameters
3500 ----------
3501 M : int
3502 Number of points in the output window. If zero or less, an
3503 empty array is returned.
3504 beta : float
3505 Shape parameter for window.
3506
3507 Returns
3508 -------
3509 out : array
3510 The window, with the maximum value normalized to one (the value
3511 one appears only if the number of samples is odd).
3512
3513 See Also
3514 --------
3515 bartlett, blackman, hamming, hanning
3516
3517 Notes
3518 -----
3519 The Kaiser window is defined as
3520
3521 .. math:: w(n) = I_0\\left( \\beta \\sqrt{1-\\frac{4n^2}{(M-1)^2}}
3522 \\right)/I_0(\\beta)
3523
3524 with
3525
3526 .. math:: \\quad -\\frac{M-1}{2} \\leq n \\leq \\frac{M-1}{2},
3527
3528 where :math:`I_0` is the modified zeroth-order Bessel function.
3529
3530 The Kaiser was named for Jim Kaiser, who discovered a simple
3531 approximation to the DPSS window based on Bessel functions. The Kaiser
3532 window is a very good approximation to the Digital Prolate Spheroidal
3533 Sequence, or Slepian window, which is the transform which maximizes the
3534 energy in the main lobe of the window relative to total energy.
3535
3536 The Kaiser can approximate many other windows by varying the beta
3537 parameter.
3538
3539 ==== =======================
3540 beta Window shape
3541 ==== =======================
3542 0 Rectangular
3543 5 Similar to a Hamming
3544 6 Similar to a Hanning
3545 8.6 Similar to a Blackman
3546 ==== =======================
3547
3548 A beta value of 14 is probably a good starting point. Note that as beta
3549 gets large, the window narrows, and so the number of samples needs to be
3550 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 3

arangeFunction · 0.85
i0Function · 0.85
sqrtFunction · 0.70

Tested by 3

test_kaiserMethod · 0.72
test_simpleMethod · 0.72
test_int_betaMethod · 0.72