Home / Science / Maths, statistics and computing / Applied mathematics / Fourier series and FFT visualiserTool #549

Fourier series visualiser with Gibbs phenomenon, epicycles drawing and FFT spectrum (amplitude, phase, windows)

See how sines and cosines build a square, sawtooth or any typed wave, watch the Gibbs overshoot, draw shapes with epicycles, and take the FFT of a formula or your own data with Hann, Hamming, Blackman or flat-top windows. All in your browser.

Keep it one tap away for everyday use.

Bookmark Fourier series and FFT visualiser?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick a wave
  2. Add terms
  3. Spectrum
Nothing is uploadedWorks offline once open

Fourier series

Coefficients

f(t) ≈ a₀/2 + Σ (aₙ cos nt + bₙ sin nt). Amplitude is √(aₙ² + bₙ²).

Report

The report has every part you have opened.

Download

What it does

Every repeating signal is a sum of sine and cosine waves. This tool shows that in three ways.

  • Series: choose a square, sawtooth, triangle, rectified sine or pulse wave, or type your own f(t). Add terms one by one and watch the partial sum close in on the wave. The coefficients aₙ and bₙ are listed (exact formulas for the standard waves), with the error and the Gibbs overshoot: near a jump the sum always overshoots by about 9 % of the jump, however many terms you add. Fejér and Lanczos smoothing show how to tame it.
  • Epicycles: any closed drawing is a sum of turning circles. Pick a shape or draw your own, and watch the circles draw it. The heart is made of only a few circles, so a handful draw it perfectly; a star’s sharp corners need many. Fewer circles give a smoother, rounder version.
  • Spectrum (FFT): type a signal such as sin(2pi50*t) or paste your own measurements (or open a CSV or Excel file), choose a window, and get the amplitude and phase spectrum with the largest peaks listed.

How to use it

  1. Series: pick the wave and slide N. Tick “Show the first five terms” to see the separate harmonics. For your own f(t), type a formula in t; it is used on −π < t < π and repeated.
  2. Epicycles: pick a shape and slide the number of circles. To draw, press Clear and draw and drag on the picture; the shape is closed when you let go.
  3. Spectrum: type x(t) with its sample rate and number of samples, or choose “My data” and paste one column of values (and give the sample rate) or two columns, time and value.

The window controls leakage: with no window a frequency between two bins spreads into wide skirts. Hann is a good default; flat top gives the most accurate amplitudes. Amplitudes are scaled so that a sine of amplitude A shows as A.

Worked example

The square wave is −1 then +1 on each half period. Its coefficients are bₙ = 4/(nπ) for odd n: 1.27324, 0.424413, 0.254648, … With N = 9 the page shows a mean square error of 0.04040 (4.04 % of the mean square). The highest point of the sum is 1.182328 at t = 0.3142 (π/10), an overshoot of 9.116 % of the wave’s height of 2. With 99 terms the top is 1.179013, and as N grows it tends to (2/π)·Si(π) = 1.178980, so the overshoot never goes away; it only gets narrower.

In the spectrum part, the default x(t) = sin(2π·50t) + 0.5 sin(2π·120t), 1000 samples at 1000 Hz, gives peaks at exactly 50 Hz (amplitude 1) and 120 Hz (amplitude 0.5) with any window, because both fit a whole number of cycles. Change 50 to 50.3: with no window the peak is reported at 50.13 Hz with amplitude 0.858 and leaks widely, while Hann gives 50.32 Hz and 0.943, and flat top gives an amplitude close to 1.

How the maths was checked

The FFT was compared with numpy.fft.fft for lengths 7, 1000, 1023 and 1024 (agreement to 10⁻¹² or better) and the windows with scipy.signal.get_window. The numerical series coefficients agree with the exact formulas to 10⁻⁶, and the Gibbs limit with SciPy’s sine integral.

Good to know

  • Amplitude between bins is lower than the true amplitude (by up to 36 % with no window, 15 % with Hann, under 0.1 % with flat top). The peak frequency is refined between bins with a parabola through the log amplitudes.
  • The FFT assumes evenly spaced samples. For uneven times use the period finder (Lomb-Scargle).
  • Phase is shown only for bins above 1 % of the largest; elsewhere it is noise.
  • The FFT takes up to 1,048,576 samples, and files up to 10 MB.

Frequently asked questions

Is my data uploaded? No. Everything runs in your browser and nothing is stored.

Why does the spectrum stop at half the sample rate? That is the Nyquist frequency: higher frequencies cannot be told apart from lower ones (aliasing).

What are negative circle speeds? In epicycles, circles turn both ways; a negative speed turns clockwise.

Where the numbers come from

  • Methods: textbook Fourier series formulas; Cooley-Tukey radix-2 FFT with Bluestein's algorithm for other lengths; periodic windows as in SciPy's get_window. Example signals and shapes are made from formulas.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Light curve period finder #48 Paste times and brightness measurements, even with gaps and uneven spacing, and find the period with a Lomb-Scargle periodogram, false alarm probabilities, alias checks and a folded light curve. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. ODE solver with phase portraits #548 Type a system of differential equations and solve it in your browser with RK4 or adaptive RK45 (as SciPy). Time plots, phase portrait with direction field and nullclines, equilibria with eigenvalues, a bifurcation diagram, and a heat and wave equation playground. Numerical methods teacher #550 See numerical methods work step by step: root finding by bisection, false position, Newton and secant with iteration tables; integration by the trapezoid, Simpson, Gauss-Legendre and Romberg rules with error plots; and Lagrange, Newton divided-difference and cubic spline interpolation. Checked against scipy. Dimensional analysis (Buckingham Pi) helper #551 List your variables with their dimensions (M L T Θ I N J) and get the dimension matrix, its rank, an integer null-space basis and the dimensionless Π groups for the repeating variables you choose. Exact arithmetic, in your browser. Chaos explorer #552 Explore chaos in your browser: the logistic map (or any typed map) with cobweb, orbit diagram, Lyapunov exponent and Feigenbaum period-doubling points; the Lorenz and Rössler attractors in a 3D view you can turn, with their Lyapunov spectrum; and the Hénon map.