DigitHelm
Advanced Equations

Discrete Fourier Transform (DFT) Calculator | Spectrum Analysis

Compute the Discrete Fourier Transform of any signal sequence of up to 16 samples. Displays each frequency bin's magnitude, phase (radians and degrees), and real and imaginary components in a full results table. Computes the Inverse DFT to verify signal reconstruction and includes common signal presets.

Instant Results100% FreeAny DeviceNo Sign-up

N = 8 samples — output will have 8 frequency bins (k = 0 … 7)

What Is the Discrete Fourier Transform (DFT) Calculator | Spectrum Analysis?

The Discrete Fourier Transform converts a sequence of N time-domain samples x[0]…x[N−1] into N frequency-domain coefficients X[0]…X[N−1]. Each bin X[k] reveals how much of the frequency k·fₛ/N is present in the signal. Bin 0 is the DC component (average value). The IDFT reconstructs the original signal from its spectrum, verifying the transform is lossless. The DFT is the foundation of digital signal processing, audio compression (MP3), image compression (JPEG), and spectral analysis.

Formula

X[k] = Σₙ x[n] · e^(−j2πkn/N)

Re[X[k]] = Σ x[n] · cos(2πkn/N)

Im[X[k]] = −Σ x[n] · sin(2πkn/N)

IDFT: x[n] = (1/N) · Σₖ X[k] · e^(j2πkn/N)

|X[k]| = √(Re² + Im²) | ∠X[k] = atan2(Im, Re)

How to Use

  1. 1

    Enter sample values x[0], x[1], … x[N-1] separated by spaces (2–16 values)

  2. 2

    Or click a preset: Impulse, DC, Sine wave, Square wave, Ramp, or 4-sample

  3. 3

    Optionally enable "Show IDFT reconstruction verification"

  4. 4

    Click Compute DFT

  5. 5

    View the magnitude spectrum bar chart (bin index vs |X[k]|)

  6. 6

    Read the full table: Re, Im, magnitude, phase (rad and degrees) for each bin k

  7. 7

    Check DC component (bin 0), Nyquist bin (N/2), and dominant frequency bin

Enter 2 to 16 sample values separated by spaces or commas. Load a preset (Impulse, DC, Sine, Square, Ramp) or type your own samples. Toggle IDFT verification to confirm reconstruction. Click Compute DFT to see the magnitude spectrum bar chart, full results table, and key frequency-domain statistics.

Example Calculation

Example: Unit impulse x=[1,0,0,0,0,0,0,0]

X[k] = Σ x[n]·e^(−j2πkn/8) = 1·e^0 = 1 for all k

|X[k]| = 1 for k = 0,1,2,…,7 (flat spectrum)

DC signal x=[1,1,…,1]: X[0]=N, X[k≠0]=0

A unit impulse has equal energy at all frequencies.

Frequently Asked Questions

What does each frequency bin represent?

Bin k represents the complex amplitude of the sinusoid with frequency f = k·fₛ/N, where fₛ is the sampling frequency and N is the number of samples. Bin 0 is the DC (average value). For real input signals, the spectrum is symmetric: X[N−k] = X[k]*, so only bins 0 through N/2 carry unique information.

What is the Nyquist frequency?

The Nyquist frequency is fₛ/2 — the highest frequency that can be represented with sample rate fₛ. It corresponds to bin N/2. Above the Nyquist, frequencies alias (appear as lower frequencies). The Nyquist-Shannon theorem states a signal must be sampled at more than twice its highest frequency to be perfectly reconstructed.

Why does the impulse have a flat spectrum?

The unit impulse δ[n] equals 1 at n=0 and 0 elsewhere. Its DFT is X[k] = e^0 = 1 for all k — perfectly flat magnitude. Conversely, the DC signal x[n]=1 has X[0]=N and X[k]=0 for k≠0, concentrating all energy at the DC bin. These two signals are DFT duals of each other.

What is the difference between DFT and FFT?

The DFT is the mathematical transform; the FFT (Fast Fourier Transform) is a fast algorithm for computing the DFT in O(N log N) time instead of O(N²). The FFT (Cooley-Tukey algorithm) is particularly efficient when N is a power of 2. The results are identical — only the computation speed differs. This calculator uses the direct O(N²) DFT formula for transparency.

You Might Also Like

Explore 360+ Free Calculators

From math and science to finance and everyday life — all free, no account needed.