Maths & numbers

Discrete Fourier transform calculator for complex sequences

Compute a direct complex DFT or inverse with explicit normalization, complete bin values, magnitudes and phases.

Your numbers

Use 1 through 256 rows. Components may use decimal or scientific notation and must be finite within ±10¹².

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The discrete Fourier transform expresses a finite sequence as complex frequency-bin coefficients. Both real and imaginary input components are accepted. The same page provides the inverse transform and three explicit normalization conventions so a round trip can be interpreted correctly. The implementation evaluates the direct quadratic-time sum for a bounded sequence size. It does not claim to be a fast Fourier transform, and no samples are silently padded, cropped or windowed.

THE FORMULAXk = Σj xj exp(−2πijk/N); inverse changes the sign, with scaling set by the selected normalization.

A worked example

For the four-sample impulse [1,0,0,0], every forward coefficient is 1 + 0i under backward normalization. Applying the inverse with the same convention returns the original impulse because the inverse includes a factor of 1/4. A constant four-sample sequence instead places its total entirely in index zero, with the other bins zero in exact arithmetic.

Good to know

Accepts 1–256 complex samples with finite components within ±10¹². Outputs are numerical complex values, so theoretically zero bins can contain small roundoff residuals and have unstable displayed phases. The table uses unshifted index order. It does not infer a sample rate, physical frequency unit, spectral density, window correction or continuous-time Fourier transform.

A complete complex sequence is needed for inversion

Magnitude alone discards phase and cannot generally reconstruct the input. The result table therefore retains every real and imaginary coefficient alongside magnitude and phase. For real input, positive and negative frequency bins have conjugate symmetry, but those negative-frequency coefficients are still included. Output indices above the positive-frequency portion are not extra high positive frequencies in an unshifted transform.

The impulse example is a useful normalization check because its flat spectrum is easy to verify directly. Another independent check is energy: under backward normalization, the sum of squared transform magnitudes divided by N equals the input energy in real arithmetic. Orthonormal scaling places the same energy in both domains without that additional factor.

A four-sample impulse has unit value in every forward frequency binTime impulseSpectrum(1,0,0,0)(1,1,1,1)
Backward-normalized forward DFT maps (1,0,0,0) to (1,1,1,1). Inverting with the same convention scales by one fourth and recovers the impulse.

The Discrete cross-correlation calculator with lag compares relative sequence alignment instead of changing the representation into frequency bins.

Direction and normalization are separate settings

The forward transform uses the negative complex exponential; the inverse uses the positive one. Backward normalization leaves the forward result unscaled and divides the inverse by N. Forward normalization moves that division to the forward direction. Orthonormal normalization scales both directions by 1/√N. Using incompatible conventions across a round trip changes amplitude even if the exponential signs are correct.

A DFT samples a finite discrete-frequency representation. Relating its bins to hertz requires the sampling rate, and interpreting a measured spectrum can also require windowing and calibration. Those assumptions are not inferred here. The lagged correlation calculator answers a different sequence-comparison question and can use autocorrelation as a mode. Keeping the inverse and normalization variants here prevents several pages from repeating the same transform workflow under different names.

A few questions, answered

Can I enter an ordinary real sequence?

Yes. Enter each real sample with imaginary component zero. The output can still have nonzero imaginary parts.

Is this an FFT calculator?

It computes the DFT directly in O(N²) work. FFT refers to faster algorithms for the same mathematical transform, not a different output definition.

Find your calculator

Start typing to explore the library.