ifft
→Tensorifft(input: Tensor, n: int | None = None, dim: int = -1, norm: str | None = None)1-D inverse discrete Fourier transform along a single axis.
Recovers the time-domain signal from its frequency-domain
representation computed by fft. For a complex frequency
sequence , the inverse DFT is:
The factor above corresponds to norm='backward'
(default). With norm='ortho' both fft and ifft
divide by , making the pair a unitary transform.
Parameters
inputTensornint= NoneNone, the axis keeps its current length.dimint= -1-1 (last axis).normstr or None= None"backward" (default), "forward", or
"ortho". See fftn for the full description.Returns
TensorComplex tensor (complex64) with the same shape as input
except that axis dim has length n (or the input length
when n is None).
Notes
Round-trip — for any complex tensor x:
up to floating-point rounding.
Real inputs — if input represents the spectrum of a real
signal (conjugate-symmetric), the imaginary part of the output will
be negligibly small. Use irfft to obtain a strictly real
output more efficiently when you know the input is conjugate-symmetric.
Examples
Round-trip reconstruction:
>>> x = lucid.randn(64)
>>> X = lucid.fft.fft(x)
>>> x_rec = lucid.fft.ifft(X)
>>> x_rec.shape
(64,)
>>> # x_rec.real ≈ x
Deconvolution in the frequency domain:
>>> H = lucid.fft.fft(lucid.randn(32)) # frequency response
>>> Y = lucid.fft.fft(lucid.randn(32)) # observed output spectrum
>>> x_est = lucid.fft.ifft(Y / H) # estimated input