01

What the inverse Fourier transform does

The Fourier transform decomposes a signal into a sum of sinusoids and reports how much of each frequency is present. The inverse transform runs that description backwards: given the amounts, it rebuilds the signal. Nothing is lost in either direction — the pair is a bijection, which is precisely why the inverse exists.

Real inverse DFT, zero phasex[n] = Σₖ Aₖ·cos(2πkn/N), n = 0 … N−1
A₀ = DC level, A₁ = fundamental, A₂ = second harmonic, …

This tool fixes N = 64 samples per period and sets every phase to zero, so each harmonic is a pure cosine starting at its maximum. That is the simplest useful case: it isolates the amplitude question from the phase question.

02

Reading the coefficient list

The list is indexed by harmonic number, not by frequency in hertz. Harmonic k completes k full cycles inside one period of the record. So if the record is one second long, harmonic 3 is 3 Hz; if the record is 20 ms long, harmonic 3 is 150 Hz.

What each entry contributes
IndexNameCycles per periodEffect on the waveform
A₀DC term0Shifts the whole signal up or down; sets the mean
A₁Fundamental1The slowest wiggle — usually the dominant shape
A₂2nd harmonic2Adds one extra crest and trough; sharpens or flattens
A₃3rd harmonic3Starts building square-ish edges
A₅, A₇ …Odd harmonics5, 7 …The terms that make a square wave look square

A negative amplitude is not a mistake — it is a cosine flipped by 180°, which is identical to a phase shift of half a cycle. Keeping the sign is often clearer than converting to degrees.

03

Worked example: 1, 0.5, 0.25

Take A = [1, 0.5, 0.25]. At n = 0 every cosine equals 1, so x[0] = 1 + 0.5 + 0.25 = 1.75. That is the highest the signal ever gets, because all three harmonics peak together at the start of the period.

A quarter of the way through (n = 16) the fundamental has gone a full quarter turn, so cos(2π·1·16/64) = cos(π/2) = 0. The second harmonic has gone half a turn, cos(π) = −1, and the third has gone three quarters, cos(3π/2) = 0. Only the middle term survives: x[16] = 1 + 0.5·0 + 0.25·(−1) = 0.75.

Sample values for A = [1, 0.5, 0.25]
Sample ncos(2πn/64)cos(4πn/64)cos(6πn/64)x[n]
01111.75
80−100.75
16−11−10.25
240−100.75
321111.75

The reported RMS is 1.0753. For a sum of cosines the mean square is Σ Aₖ²/2 for every non-DC term, so here it is 1² + (0.5² + 0.25²)/2 = 1.15625, and √1.15625 = 1.0753. Parseval's theorem in one line: you can compute the energy either from the waveform or from the coefficients.

04

Peak versus RMS

The peak is the largest absolute sample in the record. The RMS is the square root of the mean of the squares. For a single pure cosine the ratio is exactly √2, so peak = 1.414 × RMS. The moment a second harmonic joins in, that ratio drifts — which is why a cheap multimeter that assumes a sine wave misreads any distorted waveform.

Crest factor is the tell. Peak divided by RMS is called the crest factor. It is 1.414 for a sine, 1.0 for a square, and higher than 1.414 whenever harmonics stack in phase at one point. Watch it as you add coefficients.

05

Where inverse transforms are used

  • Audio synthesis — additive synthesis is literally this formula: stack harmonics until the timbre matches.
  • Signal reconstruction — after filtering in the frequency domain, the inverse brings you back to something you can play or plot.
  • Image compression — JPEG stores DCT coefficients and rebuilds blocks with the inverse; the maths is the same family.
  • Vibration analysis — measured spectra are inverted to predict the time-domain displacement a machine will see.
  • Antenna design — the far-field pattern and the aperture distribution are a Fourier pair.
06

Limits of this tool

Two things are deliberately simplified. First, every phase is zero, so the reconstructed waveform is always symmetric about the start of the period. Real spectra carry a phase per harmonic and the waveform shifts accordingly. Second, the record is 64 samples, which resolves harmonics up to the 32nd before aliasing folds them back.

If you need arbitrary phases, the general form is x[n] = Σ Aₖ·cos(2πkn/N + φₖ). The peak changes as soon as any φₖ is non-zero, even when every amplitude is untouched — which is exactly the trap in comparing two spectra by amplitude alone.

?

Frequently asked questions

What does the first coefficient mean?

It is the DC term, A₀. It sets the average level of the waveform and contributes the same amount to every sample, so it shifts the whole signal up or down without changing its shape.

Why is the peak at n = 0?

Because every cosine equals 1 at n = 0, so all harmonics add in phase there. With zero phases the maximum of the reconstructed signal always sits at the start of the period.

How do I convert harmonic number to hertz?

Multiply by the fundamental frequency, which is one over the length of the record. If the record covers 20 ms, the fundamental is 50 Hz, so harmonic 3 is 150 Hz.

Why does a square wave need so many coefficients?

A square edge is discontinuous, and a sum of smooth cosines can only approach a jump by adding infinitely many terms. Truncating the series produces the ringing known as the Gibbs phenomenon, which never fully disappears.

Is the inverse Fourier transform the same as the forward one?

They are the same formula up to a sign in the exponent and a 1/N scale factor. For real, even signals the two are identical, which is why this tool can rebuild a waveform from amplitudes alone.

What does RMS tell me that the peak does not?

RMS measures average power, which is what actually heats a resistor or moves a speaker cone. The peak tells you the worst case a component must survive. Both matter, and they diverge as soon as the waveform is not a pure sine.