fn
general_gaussian
→Tensorgeneral_gaussian(M: int, p: float = 1.0, sig: float = 7.0, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)Generalised Gaussian window.
Family parametrised by a shape exponent p and width sig,
interpolating between the standard Gaussian (p = 1) and an
increasingly flat-topped, sharper-edged window as p grows
large. Useful when a Gaussian-like taper is desired but with more
energy concentration in the centre samples.
Parameters
MintNumber of samples in the output window; must be
>= 0.pfloat= 1.0Shape exponent;
p = 1 is the standard Gaussian, p > 1
flattens the top. Defaults to 1.0.sigfloat= 7.0Width parameter analogous to
std; defaults to 7.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:
As the window approaches a rectangular shape of half-width .
Examples
>>> from lucid.signal.windows import general_gaussian
>>> general_gaussian(5, p=2.0, sig=1.5)
Tensor([0.4111, 0.9023, 1.0000, 0.9023, 0.4111])