GestureSynth.me

Music calculator

Inverse Discrete Fourier Transform Calculator

Reconstruct a real or complex time sequence from unshifted Fourier bins using the positive exponential and 1/N inverse scaling.

inverse discrete fourier transform calculator

Inverse Discrete Fourier Transform Calculator guide

The inverse discrete Fourier transform reconstructs samples from a full set of frequency coefficients. Enter real parts in order beginning with DC, then supply the matching imaginary parts. A single zero in the imaginary field is shorthand for an entirely real list of coefficients.

Play the instrument ↑
Default result
4 reconstructed samples

Calculation and units

For sample n, rotate bin k by a positive angle of two pi times k times n divided by N. Add the resulting complex values and divide both components by N. The table includes the reconstructed real and imaginary values plus their magnitude. The imaginary output is retained so an incomplete conjugate pair is visible.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Two real side bins

Real bins in DFT order = 0 2 0 2 · Imaginary bins (0 for all zero) = 0.

4 reconstructed samples. Positive exponential divided by 4. Sample zero has real part 1 and imaginary part 0. Table readings (Sample, Real, Imaginary, Magnitude): (0, 1, 0, 1) / (1, 0, 0, 0) / (2, -1, 0, 1) / (3, 0, 0, 0).

The equal side bins reconstruct one real cosine cycle. Each input coefficient carries half of the total unnormalized cosine magnitude.

DC component

Real bins in DFT order = 12 0 0 0 · Imaginary bins (0 for all zero) = 0.

4 reconstructed samples. Positive exponential divided by 4. Sample zero has real part 3 and imaginary part 0. Table readings (Sample, Real, Imaginary, Magnitude): (0, 3, 0, 3) / (1, 3, 0, 3) / (2, 3, 0, 3) / (3, 3, 0, 3).

The coefficient at zero is divided by four and contributes the same value at every time index.

Flat real spectrum

Real bins in DFT order = 1 1 1 1 · Imaginary bins (0 for all zero) = 0.

4 reconstructed samples. Positive exponential divided by 4. Sample zero has real part 1 and imaginary part 0. Table readings (Sample, Real, Imaginary, Magnitude): (0, 1, 0, 1) / (1, 0, 0, 0) / (2, 0, 0, 0) / (3, 0, 0, 0).

Equal real coefficients reinforce at sample zero. Their rotating phases cancel at the other three sample positions.

Single rotating component

Real bins in DFT order = 0 4 0 0 · Imaginary bins (0 for all zero) = 0.

4 reconstructed samples. Positive exponential divided by 4. Sample zero has real part 1 and imaginary part 0. Table readings (Sample, Real, Imaginary, Magnitude): (0, 1, 0, 1) / (1, 0, 1, 1) / (2, -1, 0, 1) / (3, 0, -1, 1).

Selecting only the positive-frequency side produces a complex time sequence. Its imaginary samples carry information about the missing partner.

Imaginary conjugate pair

Real bins in DFT order = 0 0 0 0 · Imaginary bins (0 for all zero) = 0 -2 0 2.

4 reconstructed samples. Positive exponential divided by 4. Sample zero has real part 0 and imaginary part 0. Table readings (Sample, Real, Imaginary, Magnitude): (0, 0, 0, 0) / (1, 1, 0, 1) / (2, 0, 0, 0) / (3, -1, 0, 1).

The opposite imaginary coefficients reconstruct a real sine. Reversing both signs reverses the waveform polarity.

Nyquist component

Real bins in DFT order = 0 0 4 0 · Imaginary bins (0 for all zero) = 0.

4 reconstructed samples. Positive exponential divided by 4. Sample zero has real part 1 and imaginary part 0. Table readings (Sample, Real, Imaginary, Magnitude): (0, 1, 0, 1) / (1, -1, 0, 1) / (2, 1, 0, 1) / (3, -1, 0, 1).

A single central coefficient on this even grid produces alternating signs with zero imaginary part throughout the sequence.

Interpreting the result

When restoring a real waveform, compare opposite-frequency bins before entry. Their real components should match and their imaginary components should have opposite signs. DC and the Nyquist coefficient of an even-length record should be real. A missing partner can create a rotating complex waveform even when every coefficient entered in the real column is positive.

Measurement and model limits

This inverse expects the unshifted order of an unscaled forward DFT. A centered spectrum, a one-sided amplitude plot or a transform using unitary normalization needs preparation first. Tiny residuals can arise from rounded coefficient values. Check sample polarity in the real column because magnitude is always nonnegative and loses that information.

Answers before you play

Common questions

Can I reconstruct from magnitude alone?

Many signals share a magnitude spectrum. Include the original phase through the real and imaginary components to recover a particular waveform.

Where do negative frequencies go?

They occupy the end of the unshifted array in ascending bin index. Keep DC first and place the first negative-frequency partner of bin one in the final slot.

What does a constant frequency list produce?

Equal real coefficients with zero imaginary parts create an impulse at sample zero. Uniformity across bins creates a localized time event.

How is time assigned to each row?

The rows give sample indexes. Divide each index by the original sample rate to obtain time in seconds from the start of the block.