Skip to content
ComputeVerse.ai

Signals & SystemsDesign workbench

DFT / FFT Spectrum Analyzer

Compute the single-sided amplitude and phase spectrum of a sampled signal (generated from a waveform or entered directly) on a correct hertz axis, with the DFT normalization stated.

About this calculator

The Discrete Fourier Transform turns N samples of a signal into N frequency bins. This analyzer computes the DFT (via a radix-2 FFT when N is a power of two, otherwise the direct transform) and presents the single-sided amplitude spectrum scaled so a pure sinusoid reads its actual amplitude — a 3 V, 50 Hz cosine shows a 3 V line at 50 Hz, not an unscaled bin value.

Generate a test signal by picking a waveform, amplitude, frequency, sample rate, and record length, or paste your own samples. The frequency axis is real hertz: bin k maps to k·fs/N, the bins run from 0 to the Nyquist frequency fs/2, and the bin spacing Δf = fs/N is reported so you can see the resolution you're buying with record length.

Two conventions are stated explicitly because they are the usual source of confusion. First, normalization: the forward DFT here carries no 1/N factor (X[k] = Σ x[n] e^{−j2πkn/N}); the amplitude readout applies the 2/N single-sided scaling (1/N at DC and Nyquist) so the numbers are physical. Second, leakage: when the signal frequency is not an exact bin (not an integer number of periods in the record), energy spreads to neighboring bins — the spectrum is exact for the sampled sequence, but reading a single bin as 'the amplitude' then understates it. Choose a record length that holds whole periods, or interpret the spread honestly.

Design notes & common mistakes

  • Amplitude scaling matters: the forward DFT here has no 1/N. The 2/N single-sided factor (1/N at DC/Nyquist) makes a sinusoid read its true amplitude.
  • Resolution vs range: Δf = f_s/N sets bin spacing; f_s/2 sets the top frequency. Only N changes the first; only f_s changes the second.
  • Leakage: if the record isn't a whole number of periods, energy smears across bins. Whole periods (or a window function) fix the amplitude readout.
  • A power-of-two N runs the fast radix-2 path; any other length still works via the direct DFT — no silent truncation or zero-padding.

Assumptions

  • The signal is uniformly sampled at the stated sample rate; samples are real-valued.
  • The spectrum is exact for the finite sampled sequence as entered — no windowing is applied (rectangular window).
  • Single-sided amplitude scaling assumes a real signal, so ± frequency pairs are combined.
  • Generated records are limited to 4096 samples.

When to use this calculator

Appropriate for

  • Finding the frequency content of a sampled signal or checking a DFT by hand
  • Teaching DFT normalization, the Hz-axis bin mapping, and frequency resolution
  • Demonstrating spectral leakage and the whole-periods condition

Not suitable for

  • Precise amplitude estimation of off-bin tones without a window function
  • Power spectral density, spectrograms, or noise-floor estimation
  • Real-time or streaming spectral analysis

What this calculator does not cover

  • Rectangular window only — no Hann/Hamming/Blackman windowing is applied, so off-bin tones leak (a windowing tool is planned).
  • Single-sided amplitude assumes a real signal; complex-input spectra are out of scope here.
  • No power-spectral-density or averaging (Welch/periodogram) — this is a single-record magnitude/phase spectrum.
  • Very short records give coarse resolution (large Δf); the peak frequency is only as precise as one bin.
  • As with every calculator on this site: results are preliminary and educational, are not verified for any specific installation, and must be reviewed against the applicable code edition and stamped by a licensed Professional Engineer before real-world use.

Frequently asked questions

Why does my sinusoid's amplitude read low in the FFT?

Spectral leakage. If the record does not contain a whole number of periods, the tone falls between bins and its energy spreads to neighbors, so a single bin understates the amplitude. Use a record length that holds whole periods, or apply a window function.

What frequency does bin k correspond to?

f_k = k·f_s/N hertz, where f_s is the sample rate and N is the record length. The usable single-sided range runs from 0 to the Nyquist frequency f_s/2, and the bin spacing is Δf = f_s/N.

How is the amplitude scaled?

The forward DFT here uses no 1/N factor. The amplitude readout applies the single-sided scaling — 2/N times the bin magnitude for interior bins, and 1/N at DC and Nyquist — so a pure sinusoid reads its true peak amplitude.

References

  • Proakis, J. G. & Manolakis, D. G., Digital Signal Processing, 4th ed., Ch. 7 (DFT, properties, and the FFT)
  • Oppenheim, A. V. & Willsky, A. S., Signals and Systems, 2nd ed., Ch. 5 (discrete-time Fourier analysis)
  • Harris, F. J., 'On the use of windows for harmonic analysis with the DFT,' Proc. IEEE, 1978 (leakage and windowing)

Related calculators

Get the ComputeVerse.ai quick reference

A free engineering quick-reference PDF, plus a note when new calculators launch across the library — one or two emails a month, nothing else.