fn
gaussian
→Tensorgaussian(M: int, std: float = 7.0, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)Gaussian window.
Produces a Gaussian-shaped taper centred on the window midpoint. Because the Fourier transform of a Gaussian is itself a Gaussian, this window achieves the (continuous-time) time-frequency uncertainty bound and is the basis of the Gabor / short-time Fourier transform.
Parameters
MintNumber of samples in the output window; must be
>= 0.stdfloat= 7.0Standard deviation in samples; defaults to
7.0. Larger
std → broader (closer to rectangular) window; smaller →
more concentrated taper.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:
Truncating an infinite Gaussian to length M produces shallow
discontinuities at the ends; choose std small enough that the
window has decayed substantially by the boundary.
Examples
>>> from lucid.signal.windows import gaussian
>>> gaussian(5, std=1.0)
Tensor([0.1353, 0.6065, 1.0000, 0.6065, 0.1353])