fn
kaiser
→Tensorkaiser(M: int, beta: float = 12.0, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)Kaiser–Bessel window.
Near-optimal window in the sense that it provides the largest fraction of energy in the main lobe for a given main-lobe width. A single parameter smoothly traverses the trade-off between time and frequency resolution; popular choices include (≈ −37 dB side-lobes), (≈ −90 dB), and (≈ −124 dB).
Parameters
MintNumber of samples in the output window; must be
>= 0.betafloat= 12.0Shape parameter; defaults to
12.0. Larger beta → wider
main lobe, lower side lobes. beta = 0 yields the
rectangular window; beta ≈ 5 approximates the Hamming
window.symbool= TrueSymmetric (
True, default) or periodic (False) variant.dtypeDTypeLike= NoneDesired dtype of the output tensor.
deviceDeviceLike= NoneTarget device for the output tensor.
Returns
Tensor1-D tensor of length M.
Notes
Sample formula:
where is the modified Bessel function of the first kind, order 0. The Kaiser-Bessel window is the discrete-time approximation to the continuous prolate-spheroidal window; the side-lobe attenuation in dB is approximately for moderate .
Examples
>>> from lucid.signal.windows import kaiser
>>> kaiser(5, beta=8.0)
Tensor([0.0046, 0.3464, 1.0000, 0.3464, 0.0046])