fn
blackman
→Tensorblackman(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
>>> from lucid.signal.windows import blackman
>>> blackman(5)
Tensor([0.0000, 0.3400, 1.0000, 0.3400, 0.0000])