Premium apps Part of Proofline

FFT Spectrum Calculator for Numeric Data

Paste samples or a time/value table: amplitude and phase spectrum, peaks and a CSV.

One value per line (or separated by spaces/commas), or two columns time, value with equal time steps (the sample rate then follows from the time column). At most 16384 samples.

Hz

Samples per second (or per unit of your x axis). Frequencies are reported in the same unit.

More options

Interpolates the spectrum on a finer grid; does not add real resolution.

Try an example: 5 Hz sine + 12 Hz cosine at 100 Hz · Time/value table (sample rate from the time column) · Same signal with a Hann window and zero padding

More about this tool

How it works

Computes the discrete Fourier transform of numeric samples of any length (exact, no truncation) and shows the single-sided amplitude and phase spectrum with a proper frequency axis, the strongest peaks with interpolated frequencies, a plot of the signal and the spectrum, and a CSV of every bin. Windows: rectangular, Hann or Hamming; optional mean removal and zero padding. For audio files use the Soundscape spectrum analyzer; this tool takes numbers. Part of the Proofline math notebook.

  • One FFT in the code base: the radix-2 Cooley–Tukey FFT of the shared audio engine (Soundscape). Lengths that are not a power of two are transformed exactly with Bluestein’s chirp-z algorithm, whose convolution runs on that same FFT.
  • Single-sided amplitude: 2·|X_k| / Σw (|X_0| / Σw and the Nyquist bin without the factor 2), so a sinusoid that falls on a bin shows its true amplitude with any window. Phase atan2(Im, Re) in degrees, relative to a cosine starting at the first sample; set to 0 where the amplitude is below 10⁻⁹ of the maximum.
  • Frequency of bin k is k·fs/n. Peaks are local maxima; their frequency is refined by a parabola through the logarithms of the three neighbouring amplitudes.
  • Verified against a direct O(n²) DFT for power-of-two and other lengths, Parseval’s theorem and the exact amplitudes and phases of test sinusoids.

Frequencies above half the sample rate fold back (aliasing) and cannot be told apart from lower ones. A finite record smears frequencies that do not fall on a bin (leakage); windows reduce but do not remove this.

Sources

Part of Proofline

Related tools

Compute the frequency spectrum of numeric data with an FFT

Paste samples or a time/value table and get the amplitude and phase spectrum, the strongest frequencies and a CSV of every bin.

What it is for

A column of numbers from a sensor, a simulation or a spreadsheet often hides periodic behaviour: a vibration at 6 Hz, a daily cycle, mains hum. A Fourier transform shows which frequencies are present and how strong each one is.

Paste one value per line and give the Sample rate, or paste two columns, time and value, and the rate follows from the time steps. Choose a Window (Hann is the safe default), whether to remove the mean, and whether to zero-pad. The tool transforms any number of samples exactly, up to 16,384, without cutting the data to a power of two.

This tool takes numbers. For audio files, use the Soundscape spectrum analyzer, which reads WAV and other formats and averages many frames.

Worked example

The first example holds 200 samples of sin(2π·5t) + 0.5·cos(2π·12t) at 100 Hz, with the window set to Rectangular. The result: the strongest component is at 5 Hz with amplitude 1 (resolution 0.5 Hz). The peak table lists bin 10 at 5 Hz with amplitude 1 and phase −90° (a sine is a cosine shifted by −90°), and bin 24 at 12 Hz with amplitude 0.49999986 and phase 0°. Both tones fall exactly on bins, so the amplitudes come out exact.

Switch to Hann and turn on zero padding. The transform grows to 256 points, the bin spacing becomes 0.390625 Hz, and 5 Hz no longer sits on a bin. The strongest peak is now estimated at 4.99706 Hz with amplitude 0.984. The interpolation between bins gets the frequency right to 0.003 Hz, but the amplitude reads low because the tone falls between bins.

How to read the result

  • Strongest frequency and Its amplitude: the main component. The frequency is refined between bins by fitting a parabola through three neighbouring amplitudes.
  • Frequency resolution is the sample rate divided by the number of points. Two tones closer than about two bins blur together.
  • Nyquist frequency is half the sample rate, the highest frequency you can see.
  • Strongest peaks gives bin, frequency, amplitude and phase. Phase is measured relative to a cosine that starts at the first sample.
  • The plots show the signal and the single-sided amplitude spectrum. The CSV lists every bin.

Tips and common mistakes

  • Get the sample rate right: every frequency scales with it. With the default of 1, frequencies are in cycles per sample.
  • Frequencies above the Nyquist frequency fold back (aliasing) and look like lower ones. Sample at least twice as fast as the fastest component.
  • Keep Remove the mean on unless the DC level itself interests you; otherwise bin 0 dominates the plot.
  • A rectangular window gives exact amplitudes only for tones that fit a whole number of cycles into the record. For real data, Hann leaks far less.
  • Zero padding draws a smoother spectrum but adds no information. More real samples add resolution.
  • The time column must be equally spaced. For irregular data, interpolate first, for example with the curve fitter's spline.

FAQ

Why is the amplitude of my sine not exactly 1?

Its frequency probably falls between two bins, so the energy is shared with the neighbours (leakage). Use a record length that holds a whole number of periods, or read the peak's interpolated frequency and accept a small amplitude error.

Does the tool need a power-of-two number of samples?

No. Other lengths are transformed exactly with Bluestein's algorithm, which runs on the same radix-2 FFT the audio tools use. Results match a direct DFT to rounding error.

What do the phase values mean?

The phase of a bin is the angle of a cosine at that frequency at the first sample, in degrees. A phase of 0° is a cosine, −90° a sine. Phases of near-empty bins are set to 0.

Can I get the power spectral density?

Not directly. The tool reports amplitudes. Square them and divide by the bin width for a rough power density of a single record.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://prooflinefftspectrum.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://prooflinefftspectrum.usefulweb.app/mcp · tool name proofline_fft_spectrum
Example request
curl -s -X POST https://prooflinefftspectrum.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{…see OpenAPI examples…}'
Feedback · ideas & bug reports welcome