hann_window(window_length: _int, periodic: _bool = ..., dtype: DTypeLike = ..., device: DeviceLike = ..., requires_grad: _bool = ...)Hann window, in the periodic form stft expects by default.
Parameters
window_lengthintNumber of samples;
>= 0.periodicboolIf
True (default) return the first window_length samples of
the symmetric window of length window_length + 1, which tiles
under a hop that divides the length. If False return the
symmetric window.dtypeDTypeLikeA floating-point dtype; the default dtype when omitted.
deviceDeviceLikeTarget device.
requires_gradboolWhether the returned window records gradients.
Returns
Tensor1-D tensor of length window_length.
Raises
lucid._C.engine.InvalidArgumentwindow_length is negative.lucid._C.engine.DtypeMismatchdtype is not a floating-point dtype.Notes
with the window length, plus one when periodic. The
same window as lucid.signal.windows.hann with sym set to
not periodic.
Examples
>>> import lucid
>>> w = lucid.hann_window(4) # zero at n = 0 up to float32 round-off
>>> lucid.allclose(w, lucid.tensor([0.0, 0.5, 1.0, 0.5]), atol=1e-6)
True