fn

exponential

Tensor
exponential(M: int, center: float | None = None, tau: float = 1.0, sym: bool = True, dtype: DTypeLike = None, device: DeviceLike = None)
source

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

Mint
Number of samples in the output window; must be >= 0.
centerfloat or None= None
Centre of the decay. If None (default), uses (N1)/2(N - 1) / 2 — only allowed when sym=True.
taufloat= 1.0
Decay time constant in samples; defaults to 1.0. Larger tau → slower decay, broader window.
symbool= True
Symmetric (True, default) or periodic (False) variant. sym=False requires an explicit center.
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:

w[n]=exp ⁣(nncτ),0n<N,w[n] = \exp\!\left( -\frac{|n - n_c|}{\tau} \right), \qquad 0 \le n < N,

where ncn_c 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])