Elysia Tools

Navigation

Math

Fourier Series Visualization

Build square and sawtooth waves with rotating vectors, or redraw a single closed path with the discrete Fourier transform.

Open static visualization

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Overview

Watch the tip of a chain of rotating vectors move through a cycle. Its vertical coordinate traces the Fourier partial sum for a square or sawtooth wave. In drawing mode, both coordinates trace the reconstructed path, so you can see what changes when you retain fewer terms.

Read the wave from the tip of the vector chain

Both presets start with analytic sine coefficients. A vector for harmonic k rotates k times per cycle, with radius |bₖ| and starting angle 0° or 180° according to the sign of bₖ. The square wave uses odd k, so a five-term sum reaches harmonic 9. The sawtooth uses every positive k and alternates the signs.

The right plot overlays the target and the finite sum for one period. At a jump of either preset, the Fourier series converges to the mean of the one-sided limits. Compare the first square-wave overshoot at two term counts to see the peak move closer to the jump while staying above the plateau.

Sample the stroke along its length

A drawing becomes a loop when you release the pointer. The tool closes the stroke with a straight segment and takes 256 equally spaced samples along the resulting contour. Each sample is a complex number x + iy, measured about the center of the drawing pad.

The discrete Fourier transform gives radii and starting angles for the rotating vectors. The mean position c₀ is a fixed offset. The tool retains the largest rotating terms first. Positive frequencies rotate counterclockwise and negative frequencies rotate clockwise.

How it works

  1. Select a square wave, sawtooth wave, or drawing. In drawing mode, make one stroke or load the example circle.
  2. Change the number of rotating terms and compare the target or input path with its reconstruction. The coefficient table lists the terms currently in use.
  3. Pause the animation or move the cycle progress slider to pick a phase. Read Sₙ for a waveform or zₙ for a path.

Edge cases & common failures

  • A stroke ends far from its starting point

    The straight closing segment is part of the contour being reconstructed. Draw the two ends near each other to make that segment short.

  • A short partial sum rounds corners

    Small details can depend on rotating terms outside the current selection. Increase the term count and compare the reconstructed path with the input line.

Examples

1. Locate the square wave's first Gibbs peak

How to use

Choose Square wave. Set 5 terms and move the cycle slider to 5%, then compare 25 terms at 1%.

Outcome

The first peak moves closer to the jump. The readout changes from 1.1823 to 1.1791 while the plateau remains at 1.

2. Check the middle of the sawtooth jump

How to use

Choose Sawtooth wave, set 4 terms and move the cycle slider to 50%.

Outcome

The partial sum is 0.0000 at the jump. The plot marks the one-sided limits at +1 and −1.

3. Follow a clockwise circle

How to use

Choose Draw a path, load the example circle and set the cycle to 25%.

Outcome

The single rotating term has k = −1. The tip is at 0.2000 − 0.6500i, below the fixed center c₀.

FAQ

Why does the starting point matter for a drawing?

The first sampled position sets phase zero. Starting at a different point on the same contour can change coefficient phases and where playback begins.

Does playback speed change the coefficients?

The speed slider changes how quickly you move through the period. The input and selected terms determine the coefficients and the reconstruction.

At a Glance

Interactive Preview

Fourier Series Visualization
Static preview of this visualization. Use the interactive panel above to explore it.

Verified Results

Typical Experiments and Results

Every parameter set and result below is a fixed output of this page's built-in model (each asserted before delivery) and reproduces directly: set the Parameters column in the interactive panel.

ScenarioParametersResult
First square-wave harmonicN = 1, θ/(2π) = 25%S₁(π/2) = 1.2732, f(π/2) = 1
Gibbs peak near a square-wave jumpN = 5, θ/(2π) = 5% → N = 25, θ/(2π) = 1%S₅ = 1.1823 → S₂₅ = 1.1791
Alternating sawtooth coefficientsN = 2, k = +1, +2|b₁| = 0.6366, φ₁ = 0.0°, |b₂| = 0.3183, φ₂ = 180.0°
Sawtooth jump midpointN = 4, θ/(2π) = 50%S₄(π) = 0.0000, f(π⁻) = +1, f(π⁺) = −1
Clockwise circle and its offsetM = 256, N = 1c₀ = 0.2000 − 0.1000i, k = −1, |c₋₁| = 0.5500
A quarter turn along the example circleN = 1, θ/(2π) = 0% → 25%z₁ = 0.7500 − 0.1000i → 0.2000 − 0.6500i

Sources

References

Papers and datasets underlying this visualization - every formula, algorithm, and data anchor on the page traces back to the sources below.

  1. [1]

    National Institute of Standards and Technology. §1.8 Fourier Series. NIST Digital Library of Mathematical Functions.

    View source→ bₖ = π⁻¹∫₋π^π f(θ)sin(kθ)dθ, S(θ₀) = (f(θ₀⁻) + f(θ₀⁺))/2
  2. [2]

    Gilbert Strang (2008). Chapter 4: Fourier Series and Integrals; Section 4.1 Fourier Series for Periodic Functions. MIT OpenCourseWare, Computational Science and Engineering I.

    View source→ Square wave, b₂ⱼ = 0, b₂ⱼ₋₁ = 4/[π(2j − 1)]
  3. [3]

    Evans M. Harrell II, James V. Herod (2000). IV. Calculating Fourier Series. Linear Methods of Applied Mathematics.

    View source→ Model Problem IV.3, centered sawtooth bₖ = 2(−1)ᵏ⁺¹/(πk)
  4. [4]

    National Institute of Standards and Technology. §6.16 Mathematical Applications. NIST Digital Library of Mathematical Functions.

    View source→ Square-wave first Gibbs peak at θ = π/(2N), Sₙ → 2 Si(π)/π
  5. [5]

    J. Willard Gibbs (1899). Fourier's Series. Nature 59, 606.

    View source→ Gibbs overshoot, Si(π) = ∫₀^π (sin t)/t dt
  6. [6]

    Brad G. Osgood. Lecture 20 - Review: Definition Of The DFT. Stanford Engineering Everywhere, EE261 - The Fourier Transform and its Applications.

    View source→ DFT basis exp(−2πikn/M), exact inverse at sample phases
  7. [7]

    Eric Persoon, King-Sun Fu (1977). Shape Discrimination Using Fourier Descriptors. IEEE Transactions on Systems, Man, and Cybernetics 7(3), 170–179.

    View source→ Complex contour z = x + iy, arc-length parameterization

Related

Related tools and workflows

Format Conversion

AsciiMath LaTeX MathML Equation Converter

Convert equations between AsciiMath, LaTeX and MathML: auto-detect the input format, produce canonical LaTeX, presentation MathML with an embedded TeX annotation, a best-effort AsciiMath back-translation, a screen-reader aria-label snippet (role=math), and a KaTeX HTML preview.

Math & Numbers

Series Convergence Tester (Ratio/Root/Integral/Comparison)

Numeric convergence tests for Σ aₙ: nth-term, ratio, root, p-series comparison, and integral test; alternating series classified by Leibniz with a sum estimate.

Math & Numbers

Fourier Series Calculator

Calculate Fourier series coefficients for common waveforms

Math & Numbers

Sum Of Series Calculator

Sum arithmetic series, geometric series, or a custom list of terms

Next

More visualizations nearby

Cookie settings

Essential cookies keep the site running. Analytics and personalized ads are optional.

Cookie policy