Analyze sampled signals for fast frequency insight. Apply windows and padding to reduce leakage errors. Export spectra, compare harmonics, and report findings with confidence.
This example is a simple repeating waveform with N=8 and Fs=8 Hz.
| n | x[n] |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 0 |
| 3 | -1 |
| 4 | 0 |
| 5 | 1 |
| 6 | 0 |
| 7 | -1 |
For a discrete signal x[n] of length M, the transform is:
Frequency for bin k is fk = k · Fs / M. Magnitude is |X[k]| = √(Re² + Im²), and phase is atan2(Im, Re).
Windowing multiplies x[n] by a taper to reduce leakage when cycles are not aligned with the sample window.
Frequency analysis begins with samples x[n] collected at Fs hertz. The usable band is 0 to Fs/2, and each bin is labeled by fk=k·Fs/M. For example, Fs=1000 and M=1024 yields 0.9766 Hz spacing. Larger N improves repeatability, reduces estimator variance, and makes comparisons across runs more stable. Document units, sensor gain, and any detrending because scaling affects magnitudes but not peak locations.
If an integer number of cycles does not fit into N samples, leakage spreads energy into neighboring bins. A rectangular window preserves amplitude but has higher sidelobes that can hide weak tones. Hann and Hamming windows reduce sidelobes, improving detection under noise, while slightly widening the main lobe. Blackman suppresses sidelobes further and is helpful for small harmonics. Keep the same window when benchmarking datasets.
Resolution is driven by observation length: Δf≈Fs/N for unpadded records. Doubling N halves Δf and separates closer frequencies. Zero padding increases M without adding information, but it refines the grid, enabling better peak frequency estimates between bins and smoother plots. This tool lists the strongest peaks excluding DC, supporting quick screening for periodicity. Confirm peaks by checking stability under different windows and by inspecting neighboring bins for a main‑lobe pattern.
The transform produces complex values X[k]=Re+jIm. Magnitude |X[k]| summarizes amplitude; power |X[k]|² supports energy comparison, variance partitioning, and signal‑to‑noise measures. Phase θ=atan2(Im,Re) reports time alignment: consistent phase across trials indicates coherent structure, while random phase suggests noise. When comparing two signals, matching dominant frequencies with consistent phase offsets often indicates a common driver.
Use spectra to detect seasonality, cyclic demand, vibration signatures, and periodic error terms in residuals. Segment long series into equal windows, compute spectra, then trend dominant frequency and power to quantify drift. Peaks at multiples of a base frequency indicate harmonics and nonlinearity. Exported tables support audits, model features, and monitoring dashboards. For reproducible reporting, always record Fs, N, window type, normalization, and one‑sided versus two‑sided output settings. Use the time‑domain table to verify clipping, offsets, and missing samples before interpreting spectral results.
For real signals, negative frequencies mirror positives. One‑sided output reports bins from 0 to Fs/2, making plots and peak lists easier to read while preserving the main information content.
Windows taper the endpoints to reduce leakage, which lowers coherent gain. Peak locations remain reliable, but magnitudes change. Keep the same window for comparisons, or use normalization and consistent settings when reporting amplitudes.
Padding increases M and refines the frequency grid, but it does not add new information. True resolution mainly depends on N and Fs. Use padding to estimate peak frequency between bins and to smooth spectra.
Select Fs at least twice the highest frequency you need to measure, and add margin for filter roll‑off. Higher Fs increases bandwidth but may require larger N to maintain fine bin spacing and stable estimates.
Remove the mean before transforming when DC is not meaningful. A large offset can dominate k=0 and obscure nearby low‑frequency structure. In generated mode, set DC to zero or subtract it in preprocessing.
Non‑sinusoidal shapes, clipping, or nonlinear processes create energy at integer multiples of a base tone. A square wave, for example, shows strong odd harmonics. Tracking harmonic ratios helps diagnose distortion and system behavior.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.