Measurement

Fourier Series & Epicycles Harmonic Waveform Synthesizer

Visualize trigonometric Fourier series decomposition, rotating epicycles, harmonic summation, and Gibbs phenomenon ringing across square, sawtooth, triangle, and rectified sine waves.

Free to use No sign-up Runs in your browser

Tool workspace

Target Periodic Waveforms

Harmonic Order & Synthesis Controls

Number of Harmonics (N)N = 5
Animation Rotation Speed1.0x

Spectral & Harmonic Analysis

Active Harmonics Count5
Total Harmonic Distortion (THD)42.9%
Theoretical Gibbs Overshoot+8.95%
Root-Mean-Square (RMS) Voltage58.78

Rotating Epicycles & Time-Domain Waveform Canvas

Rotating epicycle circles on the left project horizontal phase to trace the synthesized waveform on the right in real-time. Notice Gibbs overshoot ~9% near square wave steps.

What is Fourier Series & Harmonic Analysis?

Introduced in 1822 by French mathematician Joseph Fourier, the Fourier series states that any periodic signal or function f(t) can be decomposed into an infinite sum of simple harmonically related sines and cosines: f(t) = a0/2 + ∑ [an cos(nωt) + bn sin(nωt)]. Mechanically, this corresponds to a chain of connected rotating circles (epicycles), where each circle has a radius equal to the Fourier coefficient and rotates at an integer harmonic multiple of the fundamental angular frequency.

How to Use the Visualizer

  1. 1Select a waveform preset: Square wave (odd harmonics), Sawtooth (all harmonics), Triangle wave (rapid 1/k² decay), or Half-wave rectified sine.
  2. 2Adjust the 'Number of Harmonics N' slider from 1 up to 40.
  3. 3At N = 1, observe a single rotating circle generating a pure fundamental sine wave.
  4. 4Increase N to 5, 15, or 30: watch the nested epicycles spin and stack up, sculpting the waveform into razor-sharp geometric edges and revealing the Gibbs ringing overshoot.

Signal Processing & Engineering Applications

Audio Synthesizers & Sound Design

Synthesize realistic musical instrument timbres (flute, brass, organ, violin) by controlling odd and even harmonic overtone spectra.

Audio & Power Electronic Filtering (THD)

Determine low-pass filter cutoff orders needed to suppress high-frequency PWM switching harmonics in solar microinverters.

Epicycle Planetary Ptolemaic Kinematics

Understand historically how ancient Greek geocentric astronomy used epicycles and deferents to fit observed retrograde planetary motions.

Frequently asked questions

What is the Gibbs Phenomenon?

The Gibbs phenomenon is the peculiar overshoot (approximately 8.95% of the jump height) that appears near jump discontinuities when approximating a piecewise smooth function (like a square wave) with a finite Fourier series. Adding more harmonics narrows the width of the oscillation spike closer to the edge, but the peak amplitude overshoot never goes away, even as N approaches infinity.

Why does a triangle wave converge much faster than a square wave?

Because the Fourier coefficients an, bn decay at a rate determined by the smoothness of the original function. A square wave has discontinuous jumps, so its coefficients decay slowly at 1/k. A triangle wave is continuous (only its derivative has jumps), so its coefficients decay as 1/k², needing far fewer harmonics to achieve a smooth visual match.

Can any arbitrary shape be drawn using epicycles?

Yes! Because any closed 2D loop in the complex plane can be parameterized as a periodic complex function z(t) = x(t) + i y(t), its complex Fourier transform produces a series of rotating vectors c_n e^{i n ω t}. This allows epicycles to trace out any drawing, sketch, or portrait with arbitrary accuracy.