fn
hfft2
→Tensorhfft2(input: Tensor, s: Sequence[int] | None = None, dim: Sequence[int] = (-2, -1), norm: str | None = None)2-D FFT of a Hermitian-symmetric complex signal over a pair of axes.
Computes the two-dimensional DFT of a Hermitian signal stored as a
one-sided half-spectrum (as produced by ihfft2), returning a
real-valued output. This is the 2-D specialisation of hfftn.
For an input of shape where , the output shape is .
Parameters
inputTensorComplex Hermitian half-spectrum tensor with at least 2 dimensions.
ssequence of int= NoneFull output sizes
(M_out, N_out) along the two transformed
axes. If None, the last axis defaults to .dimsequence of int= (-2, -1)The two axes over which to compute the transform. Default is
(-2, -1).normstr or None= NoneNormalisation mode —
"backward" (default), "forward", or
"ortho". See fftn for the full description.Returns
TensorReal tensor (float32) with the same shape as input
except the last transformed axis has length s[-1] (or
by default).
Notes
Odd-length last axis — always pass s explicitly when the
original last axis had an odd length to avoid the default
even-length assumption.
Examples
Recover a real 2-D signal from its Hermitian half-spectrum:
>>> H = lucid.randn(64, 33) # half-spectrum for 64×64 real image
>>> y = lucid.fft.hfft2(H, s=[64, 64])
>>> y.shape
(64, 64)