CalcWorldHub
Free online calculator · no signup

Discrete Fourier transform spectrum calculator

Transform a short real or complex sample block into its full two-sided discrete frequency spectrum.

4,000 tools
Discrete Fourier transform spectrum calculator — Real sample components, Imaginary components, same length, Sampling rate (Hz) and calculation method
Discrete Fourier transform spectrum calculator: inputs and calculation method.

How to use this calculator

Transform a short real or complex sample block into its full two-sided discrete frequency spectrum.

  1. Enter Real sample components, Imaginary components, same length, Sampling rate (Hz). Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Discrete Fourier transform spectrum explained

DC magnitude0
DC magnitude: 0 in the worked scenario.

How the calculation works

X[k]=Σx[n]e^(−j2πkn/N), unnormalized forward DFT

For each bin, rotate every complex sample by the negative bin phase and sum its real and imaginary contributions. Frequencies above the positive Nyquist index are labeled as wrapped negative frequencies. No magnitude, window, or sample-count normalization is hidden.

Set up the calculation

r — Real sample components
Real sample components. Use comma-separated values in the stated order.
i — Imaginary components, same length
Imaginary components, same length. Use comma-separated values in the stated order.
fs — Sampling rate (Hz)
Sampling rate (Hz).

Limits of this model

Up to 256 samples with no automatic window. Forward transform is unnormalized, and amplitudes are not doubled into a one-sided spectrum.

Check this example

Real sample components = 1, 0, -1, 0; Imaginary components, same length = 0, 0, 0, 0; Sampling rate (Hz) = 8.

  • DC magnitude: 0
  • Bins: frequency, real, imaginary: 0 Hz: 0, 0; 2 Hz: 2, 1.224647e-16; 4 Hz: 0, -2.449294e-16; -2 Hz: 2, 3.673940e-16

For samples [1,0,−1,0] with zero imaginary part, DC is zero. The full unnormalized transform is [0,2,0,2], with the last bin representing the negative-frequency partner.

Source

SciPy FFT tutorial, Discrete Fourier Transform section. Describes the length-N transform and normalization conventions; this calculator reports the unnormalized forward DFT.

Interpreting the result

The DC bin is the magnitude of the sample sum, so it is zero for the default sequence whose positive and negative samples cancel. Other bins describe discrete frequency components; magnitude alone omits phase, and this forward transform is unnormalized.

Frequently asked questions

Do negative frequencies appear?

Bins above Nyquist represent wrapped negative frequencies.

Is the transform normalized by N?

No, divide magnitudes by N when that normalization is intended.

Are samples windowed automatically?

No.

How do I use the Discrete Fourier transform spectrum calculator?

Enter Real sample components, Imaginary components, same length, Sampling rate (Hz). Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Discrete Fourier transform spectrum?

Real sample components = 1, 0, -1, 0; Imaginary components, same length = 0, 0, 0, 0; Sampling rate (Hz) = 8. DC magnitude: 0 Bins: frequency, real, imaginary: 0 Hz: 0, 0; 2 Hz: 2, 1.224647e-16; 4 Hz: 0, -2.449294e-16; -2 Hz: 2, 3.673940e-16 For samples [1,0,−1,0] with zero imaginary part, DC is zero. The full unnormalized transform is [0,2,0,2], with the last bin representing the negative-frequency partner.