b2KIT

FFT Spectrum Analyzer

Compute Fast Fourier Transforms of signals. Visualize frequency spectrum, apply windowing functions, and identify dominant frequencies.

Tested tool guide Tested browser tools Checked August 16, 2026

What FFT Spectrum Analyzer does, with a checked example

Supply a sequence of uniformly spaced signal samples and its sampling rate to inspect which frequency bins are strongest. The analyzer applies the selected window, computes an FFT, plots the spectrum, and identifies dominant components. The common mistake is treating a plotted bin as an exact continuous frequency. Bin spacing equals the sampling rate divided by the sample count, so a tone between bins can spread across neighboring bins and the reported dominant bin is only a sampled frequency location.

Worked example

A concrete input and expected output from the current implementation.

Input

Samples: 0, 1, 0, -1
Sampling rate: 4 Hz
Window: Rectangular

Expected output

Positive-frequency bins: 0 Hz = 0, 1 Hz = the only nonzero peak, 2 Hz = 0. Dominant frequency: 1 Hz.

These samples form one discrete sinusoidal cycle per four-sample record. Using the standard unnormalized DFT convention, the four-point transform is [0, -2i, 0, 2i]. The values are purely imaginary because the sample sequence has odd, sine-like symmetry, and for real input the 3 Hz bin is the negative-frequency counterpart of the 1 Hz bin.

How the result is produced

1

Frequency bins

For N uniformly spaced samples acquired at Fs samples per second, bin k represents k Fs/N before negative-frequency interpretation. With real-valued input, the upper half mirrors the lower half, so a one-sided plot normally runs from 0 through the Nyquist bin when N is even. Changing Fs relabels the horizontal axis; changing N changes the spacing.

2

Windowing and peaks

A rectangular window leaves the entered samples unchanged. Tapered windows reduce the endpoint jump that causes spectral leakage, but they widen the main lobe and change peak heights. The analyzer transforms the windowed sequence and identifies the strongest displayed components. Compare runs with the same window and record length, because a different taper can make the same sinusoid look broader or shorter.

Good uses

  • Confirm whether a sampled vibration record is dominated by the expected rotation rate or by a nearby component.
  • Find the fundamental tone and visible harmonics in a short audio sample whose sampling rate is known.
  • Compare rectangular and tapered windows to determine whether a suspected side peak is spectral leakage.

Limits and checks

  • An FFT cannot recover content already aliased during sampling. Frequencies above half the sampling rate can appear as lower-frequency peaks, and the resulting spectrum does not reveal their original frequencies.
  • The frequency grid is Fs/N. A short record can place nearby tones in the same broad feature, and reading additional decimal places from the plot does not create more resolving power.
  • Window choice trades reduced distant leakage for wider peaks and changed heights. A weak frequency near a strong one may be hidden, and heights from different windows are not directly comparable without accounting for window gain.

Common questions

Why does a pure sine wave occupy several frequency bins?

The sampled record may not contain an integer number of cycles. Its two ends then fail to join smoothly when treated as a repeating record, producing spectral leakage. A tapered window can suppress leakage farther from the main peak, but it broadens that peak and does not change the basic Fs/N bin spacing.

Does the tallest peak equal the sinusoid's physical amplitude?

Not safely from peak height alone. A window can attenuate a bin-centered tone, while one-sided and two-sided spectra and different transform normalizations use different scale factors. Unless the displayed amplitude convention is explicitly labeled, use height for comparisons made with identical settings, not as a physical amplitude measurement. The dominant frequency bin can still be useful.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools