Virtual laboratory/Mathematics/University-level mathematics/Fourier series and the Gibbs phenomenon

Fourier series and the Gibbs phenomenon

Every periodic function can be decomposed into a sum of sines (a Fourier series). Add harmonics and watch the sum reproduce the square wave better and better — except in one place: at the jump it stubbornly "overshoots" by about ~9%. This is the Gibbs phenomenon, which does not vanish even as N→∞.

Fourier series and the Gibbs phenomenon
Mathematics · Analysis · academic level
Number of harmonics NN9
We add more and more harmonics. At a jump of the function there appears:
harmonics N
9
sum peak
1.180
overshoot
+18.0%
🎯 Challenge: true or myth?
streak: 0

I’ll give you a statement about the Fourier series and the Gibbs phenomenon — decide whether it is true.

What just happened?

Every periodic function can be decomposed into a sum of sines (a Fourier series). By adding successive harmonics, we reproduce even a sharp square wave better and better — but only away from the jump. At the jump itself the sum stubbornly “overshoots”.

The square-wave series:

f(x)=4π∑k=1Nsin⁡((2k−1)x)2k−1f(x) = \frac{4}{\pi}\sum_{k=1}^{N}\frac{\sin((2k-1)x)}{2k-1}

Only odd harmonics, with decreasing amplitudes. The more terms, the sharper the jump — but the overshoot remains.

The invariant — the Gibbs phenomenon:

The size of the overshoot tends to ≈ 8.95% of the jump height and does not shrink, even if we add infinitely many harmonics. Only the width of the “ear” changes — it contracts, but its height remains.

Why you need this for the exam:

This is an academic extension of trigonometric functions and series. Fourier analysis is the basis of sound and image processing — and the Gibbs phenomenon is a real compression artefact (e.g. “ghosts” around edges in JPEG).

Remember: a Fourier series approximates a function by a sum of sines, but at a jump an overshoot of ~9% remains (Gibbs) — it narrows, it does not vanish.

Illustrative model · NexTutor Virtual Laboratory

Enjoyed the experiment? Share it.

It's free — send it to friends from school.

Theory & formulas

Fourier series

We decompose a periodic function into a sum of sines and cosines: f(x)=a02+∑n=1∞(ancos⁡nx+bnsin⁡nx)f(x)=\frac{a_0}{2}+\sum_{n=1}^{\infty}\left(a_n\cos nx+b_n\sin nx\right)

Square wave

For a square wave only the odd harmonics remain: f(x)=4π∑k=0∞sin⁡((2k+1)x)2k+1f(x)=\frac{4}{\pi}\sum_{k=0}^{\infty}\frac{\sin\big((2k+1)x\big)}{2k+1}

The Gibbs phenomenon

At the jump, every finite sum "overshoots" by about 8.95%8.95\% of the height of the jump. The overshoot does not vanish as N→∞N\to\infty — only its width shrinks.

Notation: an,bna_n,b_n Fourier coefficients, n,kn,k harmonic indices.

Frequently asked questions

›

Why does a sum of sines produce sharp edges?

Because by adding ever higher harmonics (faster-oscillating sines), we sum ever sharper "ripples" that pile up at the location of the jump. The infinite sum reproduces the perfect edge — but every finite sum still has rounding and an overshoot.

›

Why doesn't the "ear" go away?

The Gibbs phenomenon: the height of the overshoot tends to ~8.95% of the jump and stays constant, even if we add infinitely many terms. Only the width of the "ear" changes — it narrows and moves toward the jump, but its height remains.

›

Where can this be seen in practice?

In signal processing and compression. Cutting off high frequencies (e.g. in JPEG or MP3) produces characteristic "ghosts" and ringing around sharp image edges or sudden changes in sound — a direct consequence of the Gibbs phenomenon.

Teaching? Embed this experiment on your site.

Free widget — paste it on your school site, blog or notes. It links to the full version.

Teaching a class or tutoring? Guide students in NexTutor →