Calculator
How to use
- Select Generate a signal or Use sampled data.
- Set dt and sample count, or paste your samples.
- Choose a window to reduce spectral leakage.
- Pick scaling that matches your convention.
- Click Compute Transform to view the spectrum.
- Use Download CSV or Download PDF for reports.
Formula used
The continuous Fourier transform (frequency form) is:
With uniform sampling t[n] = t0 + n·dt, an N-point discrete approximation is:
- Windowing multiplies samples by w[n] before the sum.
- Zero padding appends zeros to refine the frequency grid.
- Single-sided correction doubles non-DC, non-Nyquist bins for real signals.
Example data table
Sine wave example: amplitude 1, frequency 5 Hz, dt 0.01 s.
| t (s) | x(t) | Note |
|---|---|---|
| 0.0000 | 0.000000 | Start of record |
| 0.0100 | 0.309017 | |
| 0.0200 | 0.587785 | |
| 0.0300 | 0.809017 | |
| 0.0400 | 0.951057 | |
| 0.0500 | 1.000000 | |
| 0.0600 | 0.951057 | |
| 0.0700 | 0.809017 |
Technical article
1) Sampling rate and Nyquist limit
Sampling interval dt sets the sampling rate fs=1/dt. The highest unaliased component is fN=fs/2. Any content above Nyquist aliases into lower frequencies, so choose dt small enough for your fastest dynamics.
2) Frequency grid and record length
The record duration is T=N·dt. Frequency bin spacing follows Δf=1/T=1/(N·dt), so longer records separate closer tones. For instance, N=256 and dt=0.01 s give T=2.56 s and Δf≈0.39 Hz.
3) Windowing, leakage, and noise bandwidth
When your record is not perfectly periodic, the rectangular window spreads energy into adjacent bins. Tapered windows reduce leakage but widen peaks. Typical equivalent-noise bandwidth (bins) is about 1.00 (rectangular), 1.50 (Hann), ~1.36 (Hamming), and ~1.73 (Blackman). Use stronger windows near large interferers.
4) Scaling conventions in the table
Different disciplines normalize transforms differently. The dt·Σ option approximates the continuous integral ∫x(t)e^{−i2πft}dt. The 1/N option matches a normalized discrete transform. For amplitude comparisons, keep scaling and window fixed across runs. If you report magnitudes, state the chosen scaling explicitly.
5) Single-sided spectra and amplitude correction
For real signals, negative-frequency terms mirror positive ones. Single-sided output shows 0 to Nyquist only. With amplitude correction enabled, non-DC and non-Nyquist bins are doubled so magnitudes better reflect one-sided energy. Disable it for two-sided spectra or complex-valued data.
6) Zero padding and peak location
Zero padding increases the number of evaluated frequency points, producing a smoother curve and better peak interpolation. It does not improve true resolution, which still depends on T. Use padding when you want cleaner tables, better peak picking, or nicer report plots. Padding can also improve visual separation in dense harmonics.
7) Phase interpretation and time alignment
Phase is computed as atan2(Im,Re) in degrees. A time shift t0 adds a linear phase term −2πf t0. Compare phase only where magnitude is strong, and keep sampling uniform to avoid misleading phase jumps.
8) A practical measurement workflow
Validate settings using a known sine wave and confirm the peak frequency. Then add a second tone and check that separation occurs when |f1−f0| > Δf. Apply a window to control leakage, and export CSV/PDF so results are archived with parameters.
FAQs
1) Why does my peak frequency look slightly off?
Small offsets usually come from finite record length. The bin spacing is Δf=1/(N·dt), so a tone can sit between bins. Try longer T or apply zero padding for smoother peak location.
2) When should I remove DC?
Remove DC when you care about oscillatory content and the mean is not physically meaningful. DC can dominate the table and hide nearby low-frequency features. Keep it when the offset itself is part of the measurement.
3) Should I always use a window?
Use a window when the record does not contain an integer number of cycles, or when you see leakage around strong peaks. Rectangular is fine for perfectly periodic records. Hann or Hamming is a strong default for measurements.
4) What is the difference between Hz and rad/s outputs?
They represent the same spectral locations with different units. The calculator converts using ω=2πf. Use Hz for most instrumentation and rad/s for analytical models and differential-equation conventions.
5) Why does zero padding not increase true resolution?
Resolution is set by the time span T. Padding adds more evaluated frequency points but does not add new time information. Peaks look smoother, yet the ability to separate close tones still depends on Δf=1/T.
6) When should I use a two-sided spectrum?
Use two-sided output for complex signals, quadrature data, or when you need signed frequency interpretation. For real-only signals, the negative side mirrors the positive side, so single-sided is typically clearer and more compact.
7) How can I compare amplitudes between different runs?
Keep the same scaling and window, then compare magnitudes at the same frequency bins. Changing scaling or window changes numeric amplitudes. Export results and note dt, N, window, and correction settings alongside plots.