ifftn
→Tensorifftn(input: Tensor, s: int | Sequence[int] | None = None, dim: int | Sequence[int] | None = None, norm: str | None = None)N-dimensional inverse discrete Fourier transform.
Recovers the original signal from its frequency-domain representation
produced by fftn. For a single axis of length , the
inverse DFT is:
The factor shown above corresponds to norm='backward'
(the default). With norm='forward' the factor becomes 1 (unscaled),
and with norm='ortho' it becomes .
Parameters
inputTensorsint or sequence of int= Nonelen(s) must equal len(dim) when both
are sequences. If None, each axis keeps its current size.dimint or sequence of int= Nonenormstr or None= None"backward"(default, same asNone) — divides by (standard inverse-DFT convention)."forward"— no division; assumes the forward transform divided by ."ortho"— divides by , matchingfftnwithnorm='ortho'.
Returns
TensorComplex tensor (complex64) with the same shape as input
except that each transformed axis i has length s[i] (or
the input size when s is None).
Notes
Round-trip property — for any complex tensor x:
up to floating-point rounding, for any valid norm mode m.
Conjugate symmetry — if the input to fftn was a real
tensor, its DFT satisfies . In that
case irfftn is preferred because it exploits this symmetry
to produce a real output more efficiently.
Examples
Round-trip through the frequency domain:
>>> x = lucid.randn(32)
>>> X = lucid.fft.fftn(x)
>>> x_rec = lucid.fft.ifftn(X)
>>> # x_rec.real ≈ x (imaginary part is ≈ 0 for a real input)
Inverse of a 2-D transform:
>>> X = lucid.fft.fftn(lucid.ones(8, 8))
>>> x = lucid.fft.ifftn(X)
>>> x.shape
(8, 8)