How to use the DFT / FFT Calculator
- 1. Enter the samplesFor example 1, 2, 3, 4. Complex values like 1+2j are fine.
- 2. Pick DFT or IDFTAdd N to zero-pad, for example to 8 points.
- 3. CalculateSee X[k] term by term, the FFT stages, the Parseval check and a plot.
DFT and the radix-2 FFT
The N-point DFT is X[k] = Σ x[n]·W_N^(kn) with the twiddle factor W_N = e^(−j2π/N), for k = 0 … N − 1. The inverse is x[n] = (1/N)Σ X[k]·W_N^(−kn). Computing it directly takes N² complex multiplications. The radix-2 decimation-in-time FFT splits the input into even and odd samples (bit-reversed order) and combines them in log₂N stages of butterflies, which needs only (N/2)·log₂N multiplications.
Worked example: x[n] = {1, 2, 3, 4} and W₄ = −j. X[0] = 10, X[1] = 1 − 2j − 3 + 4j = −2 + 2j, X[2] = 1 − 2 + 3 − 4 = −2 and X[3] = −2 − 2j. In the FFT, the bit-reversed input is 1, 3, 2, 4. Stage 1 gives 4, −2, 6, −2 and stage 2 gives 10, −2 + 2j, −2, −2 − 2j.
Exam tips
- Powers of W repeat every N. Reduce kn mod N before you multiply.
- For real x[n], X[N − k] is the complex conjugate of X[k], so you only need about half the bins.
- X[0] is the sum of all the samples, which is a quick check.
- Zero-padding gives a finer frequency grid but no new information. Bin k is the frequency k·fs/N.
Frequently asked questions
What is the maximum length?
Up to 1024 points. The full term-by-term working is shown for N ≤ 8 and the butterfly stages for N ≤ 16.
Can I enter complex samples?
Yes: 1+2j, -j, 3∠90 and similar forms all work, for both the DFT and the inverse DFT.
Why do I see tiny numbers like 1e-16 in other tools but not here?
Rounding errors from floating-point maths are cleaned up, so exact zeros show as 0.
Is this tool free?
Yes. You fill in a short form once to see your result, and the other Uncodemy tools then open without it. All the maths runs in your browser.