fn

nuttall

Tensor
nuttall(M: int, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)
source

Nuttall four-term window.

A four-term cosine-sum window with coefficients optimised by Nuttall to drive the peak side-lobe to approximately 98dB-98\, \text{dB}, the deepest practical suppression among four-term windows. Useful for very-high-dynamic-range spectral analysis at the cost of a wider main lobe.

Parameters

Mint
Number of samples in the output window; must be >= 0.
symbool= True
Symmetric (True, default) or periodic (False) variant.
dtypeDTypeLike= None
Desired dtype of the output tensor.
deviceDeviceLike= None
Target device for the output tensor.

Returns

Tensor

1-D tensor of length M.

Notes

Sample formula (four-term general_cosine with coefficients [0.3635819, 0.4891775, 0.1365995, 0.0106411]):

w[n]=0.36358190.4891775cos ⁣(2πnN1)+0.1365995cos ⁣(4πnN1)0.0106411cos ⁣(6πnN1).w[n] = 0.3635819 - 0.4891775 \cos\!\left(\frac{2\pi n}{N - 1}\right) + 0.1365995 \cos\!\left(\frac{4\pi n}{N - 1}\right) - 0.0106411 \cos\!\left(\frac{6\pi n}{N - 1}\right).

The main-lobe is roughly 16π/N16\pi/N wide.

Examples

>>> from lucid.signal.windows import nuttall
>>> nuttall(5)
Tensor([0.0004, 0.2270, 1.0000, 0.2270, 0.0004])