hfft
→Tensorhfft(input: Tensor, n: int | None = None, dim: int = -1, norm: str | None = None)1-D FFT of a Hermitian-symmetric complex signal.
Computes the one-dimensional DFT of a Hermitian (conjugate-symmetric)
signal stored as a one-sided half-spectrum, returning a real-valued
output. This is the 1-D specialisation of hfftn.
A Hermitian signal satisfies , so only complex values need to be given as input. The transform is mathematically:
where the full spectrum is reconstructed from the half-spectrum by Hermitian extension before the sum is evaluated.
Parameters
inputTensordim is
expected to have length .nint= NoneNone, the output
defaults to where is the input axis
length. Specify n explicitly when the original signal
length was odd.dimint= -1-1.normstr or None= None"backward" (default), "forward", or
"ortho". See fftn for the full description.Returns
TensorReal tensor (float32) with the same shape as input
except that axis dim has length n (or
when n is None).
Notes
Usage pattern — hfft is rarely needed in signal processing
pipelines that use the standard rfft / irfft pair. It
becomes useful when working in the frequency domain: if you have
synthesised or modified a Hermitian spectrum directly and want to
recover the implied real time-domain signal, hfft does it in
one call without needing to materialise the full (redundant) spectrum.
Examples
Construct a Hermitian half-spectrum and recover the real signal:
>>> half_spec = lucid.randn(33) # half-spectrum for N=64
>>> y = lucid.fft.hfft(half_spec, n=64)
>>> y.shape
(64,)
Round-trip with ``ihfft``:
>>> x = lucid.randn(64)
>>> H = lucid.fft.ihfft(x)
>>> x_rec = lucid.fft.hfft(H, n=64)
>>> x_rec.shape
(64,)