# Fourier Series & FFT Visualizer - Gibbs, Epicycles, Spectrum

> Fourier series coefficients and animated partial sums for square, sawtooth, triangle or any function (Gibbs), draw-your-own epicycles and FFT spectra.

- URL: https://qilingtools.com/en/math/fourier
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Physics](https://qilingtools.com/en/tags/physics), [Education](https://qilingtools.com/en/tags/education), [Charts & Visualization](https://qilingtools.com/en/tags/chart)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Three classic Fourier scenes in one place. Fourier series: pick a square, sawtooth, triangle or pulse wave (adjustable duty cycle) or type any f(x) to expand on [−L, L]. Presets use exact formulas for aₙ and bₙ; custom functions are integrated numerically with adaptive Gauss–Kronrod. Drag the number of terms N or press play to watch the partial sum approach the function term by term — the roughly 9% Gibbs overshoot next to a jump is plain to see and measured live — with a stem chart of the coefficients and a link that sends the partial sum to the grapher. Epicycles: press and drag to draw any closed shape (or pick a heart, star or square); the path is resampled to 256 points by arc length and transformed with a complex DFT, so each frequency becomes a circle spinning at a constant rate, and chaining them largest first makes the tip retrace your drawing. Change the number of circles to watch detail appear. FFT spectrum: enter a synthetic signal (sample rate, length and reproducible Gaussian noise) or paste samples, choose a rectangular, Hann, Hamming or Blackman window, and get the single-sided amplitude spectrum (linear or dB), the phase spectrum and a list of the main components. Power-of-two lengths use a radix-2 FFT; any other length gets an exact DFT via Bluestein’s algorithm.

## How to use

1. Choose a panel: Fourier series, epicycle drawing or FFT spectrum
2. Pick a waveform or enter a function or signal; set the terms, circles, sample rate or window
3. Watch the partial sums and coefficients, the epicycle reconstruction, or read off the peak frequencies, amplitudes and phases

## Features

- Exact coefficients for square, sawtooth, triangle and pulse waves
- Numerical Fourier coefficients for any function
- Animated partial sums with live Gibbs overshoot
- Draw a closed shape → epicycle animation
- FFT amplitude (linear/dB) and phase spectra
- Hann, Hamming and Blackman windows with coherent-gain correction
- Exact DFT of any length (Bluestein)
- Peak table; send partial sums to the grapher

## FAQ

### What is the Gibbs phenomenon, and do more terms remove it?

When a function has a jump, its Fourier partial sums overshoot and ripple on both sides of the jump. Adding terms squeezes the ripples closer to the discontinuity, but the largest overshoot never shrinks: it stays at about 8.95% of the jump (a square wave jumping from −1 to 1 peaks near 1.179). It’s the unavoidable price of building a discontinuous function from smooth sines; at the jump itself the series converges to the average of the two one-sided limits.

### Why doesn’t the FFT amplitude match my signal’s amplitude?

The single-sided spectrum is already doubled and divided by the window’s coherent gain, so a sine whose frequency falls exactly on a bin (k·fs/N) reads its peak amplitude. When the frequency falls between bins, energy leaks into neighbouring bins and the peak reads low — spectral leakage. Windows such as Hann or Blackman reduce the leakage side lobes at the cost of a wider main peak. For finer frequency resolution you need a longer recording (Δf = fs/N).

### How do epicycles redraw a shape?

The closed path is treated as complex numbers z = x + iy, and its discrete Fourier transform gives coefficients c_k with z(t) = Σ c_k·e^(ikt): each term is a circle of radius |c_k| turning k times per cycle. Chain the circles largest first and the tip of the last one traces the shape over time. A few big circles give a smooth outline; more circles add detail, and with all 256 the sampled points are reproduced exactly.

### How are aₙ and bₙ computed?

A function with period 2L is expanded as f(x) ≈ a₀/2 + Σ[aₙcos(nπx/L) + bₙsin(nπx/L)], with aₙ = (1/L)∫f(x)cos(nπx/L)dx and bₙ = (1/L)∫f(x)sin(nπx/L)dx over [−L, L]. Preset waves use closed forms (for a square wave bₙ = 4/(nπ) for odd n); custom functions are integrated over 16 sub-intervals with adaptive Gauss–Kronrod to about 1e−10. Odd functions have all aₙ = 0 and even functions all bₙ = 0.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
