Inverse FFT

Shipping
inverse_fft

Reconstruct time signal from one-sided magnitude + optional phase spectrum

Signature

Inputs

  • magnitudeSignalrequired
  • phaseSignal

Outputs

  • signalSignal

Parameters

KeyTypeDefaultNotes
sample_ratefloat1000.0Hz

Description

Inverse FFT reconstructs a real-valued time-domain signal from a one-sided spectrum: a required magnitude port and an optional phase port (in radians). It is the natural inverse of the fft node, which emits the same one-sided magnitude/phase representation. When phase is absent, every bin is assumed to have zero phase, yielding a purely cosine-phased reconstruction.

Internally the node rebuilds a full Hermitian-symmetric two-sided complex spectrum from the one-sided input — bin and its mirror bin are complex conjugates — then applies a real inverse DFT. This guarantees a real output with no residual imaginary part. For a one-sided magnitude of length , the reconstructed signal has length ; the magnitude input must contain at least 2 samples.

The sample_rate parameter (Hz, default 1000.0, min 1.0) sets the timebase assigned to the reconstructed signal: samples are spaced . It does not affect sample values, only the timestamps attached to the output.

The node is stateless — output depends only on the current inputs, with no memory across evaluations. Units on magnitude propagate to the reconstructed amplitude; phase is treated as dimensionless radians. Per-bin uncertainty on the spectral inputs is not analytically re-propagated through the nonlinear magnitude/phase-to-complex mapping.

Mathematics

Examples

Round-trip FFT then inverse FFT

Feed a signal through fft, then route its magnitude and phase outputs into inverse_fft with sample_rate matched to the original. The reconstruction recovers the source waveform to numerical precision.

signal_generator -> fft -> {magnitude, phase} -> inverse_fft -> sink

A 64-sample input produces a one-sided magnitude of length , and inverse_fft returns samples.

Zero-phase synthesis from a magnitude template

Connect only the magnitude port with a hand-built spectrum (e.g. a single nonzero bin) and leave phase unconnected. The node assumes everywhere, so a lone magnitude spike at bin synthesizes a cosine of frequency . Setting sample_rate = 8000 places that tone on an 8 kHz timebase.

Applications

  • Spectral editing: transform to the frequency domain with `fft`, mask or reweight `magnitude` bins (denoising, band suppression), then resynthesize the time signal with `inverse_fft`.
  • Waveform synthesis from a designed magnitude spectrum, e.g. building band-limited test tones or arbitrary harmonic mixtures for stimulus generation.
  • Zero-phase filtering pipelines, where a magnitude response is applied in the frequency domain and inverted back without introducing phase distortion.
  • Teaching and verification of the FFT/IFFT round-trip and Hermitian symmetry of real-signal spectra in university signal-processing courses.

Neat

Because the two-sided spectrum is forced Hermitian-symmetric, the output is exactly real by construction — there is no imaginary component to discard, unlike a naive complex IFFT.

Output length is always even: $(M-1)\times2$. A one-sided spectrum can only represent signals of even length, so odd-length originals cannot be reconstructed bit-for-bit through this path.

Known issues

The reconstruction length is fixed at $(M-1)\times2$; original signals of odd length lose one sample through the one-sided round-trip and cannot be recovered exactly.

A `magnitude` input with fewer than 2 samples is rejected — a single-bin (DC-only) spectrum is not a valid input.

See also

ifftspectrumreconstructionfrequency-domainsynthesishermitian