Skip to main content

kaiser

Function kaiser 

Source
pub fn kaiser(m: usize, beta: f64) -> FerrayResult<Array<f64, Ix1>>
Expand description

Return the Kaiser window of length m with shape parameter beta.

The Kaiser window is defined as: w(n) = I_0(beta * sqrt(1 - ((2n/(M-1)) - 1)^2)) / I_0(beta)

where I_0 is the modified Bessel function of the first kind, order 0.

This is equivalent to numpy.kaiser(M, beta).

§Edge Cases

  • m == 0: returns an empty array.
  • m == 1: returns [1.0].

§Errors

Returns FerrayError::InvalidValue only if beta is NaN. For any finite beta the window is computed directly as I_0(beta * sqrt(...)) / I_0(beta), matching numpy.kaiser (_function_base_impl.py:3735), which never rejects a finite beta. I_0(beta) stays finite up to the f64 exp overflow point ln(f64::MAX) ≈ 709.78, so e.g. beta = 709 yields a finite window; for beta >= 710 both numerator and denominator overflow and NumPy returns its Inf/Inf = NaN degenerate window, which this function reproduces exactly (#294, #1087).