blackman(M: int, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)Blackman window.
Three-term cosine-sum window designed by Blackman and Tukey to drive the first three side-lobes substantially below the Hann level. Peak side-lobe attenuation is with a main-lobe roughly twice as wide as the Hann window.
Parameters
MintNumber of samples in the output window; must be
>= 0.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 (special case of general_cosine with
coefficients [0.42, 0.50, 0.08]):
The slightly different "exact Blackman" uses coefficients derived
from the first two zeros of the side-lobe envelope; the standard
[0.42, 0.50, 0.08] truncation used here is the textbook form.
Examples
>>> import lucid
>>> from lucid.signal.windows import blackman
>>> w = blackman(5) # the endpoints are zero up to float32 round-off
>>> lucid.allclose(w, lucid.tensor([0.0, 0.34, 1.0, 0.34, 0.0]), atol=1e-6)
TrueUsed by 1
- lucid._ops.composite.spectral