fn
exponential
→Tensorexponential(M: int, center: float | None = None, tau: float = 1.0, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)Exponential (Poisson) window.
Two-sided exponential decay centred at a user-controllable point.
Useful for emphasising one end of a frame (e.g., the most recent
sample in an online buffer when center = M - 1), or as the
impulse-response window of an exponentially-decaying filter.
Parameters
MintNumber of samples in the output window; must be
>= 0.centerfloat or None= NoneCentre of the decay. If
None (default), uses
— only allowed when sym=True.taufloat= 1.0Decay time constant in samples; defaults to
1.0. Larger
tau → slower decay, broader window.symbool= TrueSymmetric (
True, default) or periodic (False) variant.
sym=False requires an explicit center.dtypeDTypeLike= NoneDesired dtype of the output tensor.
deviceDeviceLike= NoneTarget device for the output tensor.
Returns
Tensor1-D tensor of length M.
Notes
Sample formula:
where is center. The double-sided exponential
corresponds to the impulse response of a symmetric one-pole IIR
filter pair.
Examples
>>> from lucid.signal.windows import exponential
>>> exponential(5, tau=2.0)
Tensor([0.3679, 0.6065, 1.0000, 0.6065, 0.3679])