Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 36 ยท Fourier Series

Common Fourier Series and the Gibbs Phenomenon

Learn the Fourier series of the square, triangle and sawtooth waves, why smooth signals converge faster, and what the Gibbs overshoot at discontinuities means.

A short catalog of series covers a large share of practical problems, and comparing them teaches a deep lesson: the smoother the signal, the faster its harmonics shrink. This lesson lists the series for the square, triangle and sawtooth waves, checks each one numerically and then explains the stubborn overshoot at jumps known as the Gibbs phenomenon.

All signals below have period 2 pi (so w0 = 1), which keeps the formulas short.

Square wave

x(t) = +1 for 0 < t < pi, -1 for -pi < t < 0 (odd):

x(t) = (4/pi) [ sin t + sin(3t)/3 + sin(5t)/5 + ... ]

Coefficients fall like 1/k, because the signal has jumps.

Sawtooth wave

x(t) = t for -pi < t < pi (odd, with a jump at +-pi):

x(t) = 2 [ sin t - sin(2t)/2 + sin(3t)/3 - ... ] = 2 sum of (-1)^(k+1) sin(kt) / k

Coefficients also fall like 1/k, with all harmonics present.

Triangle wave

x(t) = |t| for -pi < t < pi (even, continuous, with corners):

x(t) = pi/2 - (4/pi) [ cos t + cos(3t)/9 + cos(5t)/25 + ... ]

Coefficients fall like 1/k^2: a continuous signal with only corners converges much faster.

Signal Smoothness Harmonic decay Harmonics present
Square jumps 1/k odd only
Sawtooth jumps 1/k all
Triangle corners (continuous) 1/k^2 odd only
Smooth (e.g. a Gaussian bump) many derivatives faster than any power many
Python Verify the three series numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Convergence speed

Because triangle coefficients shrink as 1/k^2, a handful of harmonics already looks excellent. For the square wave you need dozens, and sharp corners remain.

Python Triangle converges faster than square

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Gibbs phenomenon

Look at the partial sums of the square wave near the jump. They overshoot the plateau and ring. Adding harmonics makes the ringing narrower and squeezes it towards the jump, but the height of the first overshoot does not shrink: it stays about 9 percent of the jump size (jump from -1 to +1 is 2, so the peak is about 1.18). In the limit the error has zero energy, yet the overshoot never disappears.

Python The overshoot does not go away

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The peak settles near 1.179. Its location pi / K approaches the jump. The fix, when ringing matters, is to taper the coefficients with a window (a Fejer or Hamming-style taper), which trades a slightly softer edge for no overshoot. Physical systems never have infinite bandwidth, so a real square wave is always a smoothed one.

Python Tapering removes the ringing

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Why symmetry and smoothness matter in practice

  • Compression: smooth signals have few significant coefficients; keep those, drop the rest.
  • Audio: the 1/k fall of a square wave gives a buzzy tone; the triangle's 1/k^2 sounds softer.
  • Design: sharp edges require wide bandwidth.
flowchart LR
    A["jump in x(t)"] --> B["coefficients decay like 1/k<br/>Gibbs ringing"]
    C["corner in x(t)"] --> D["coefficients decay like 1/k^2"]
    E["smooth x(t)"] --> F["coefficients decay rapidly"]

Each extra order of smoothness buys one more power of 1/k in the decay.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which signal has Fourier coefficients that fall off fastest?

    The triangle wave is continuous; its coefficients shrink like 1/k^2, versus 1/k for the signals with jumps.
  2. 2. Which harmonics does the sawtooth contain?

    The sawtooth lacks half-wave symmetry, so it has every harmonic with b_k = 2(-1)^(k+1)/k.
  3. 3. The Gibbs overshoot of a Fourier partial sum at a jump is about:

    The height of the first overshoot converges to about 9 percent of the jump size; only its width shrinks.
  4. 4. A common way to reduce Gibbs ringing is to:

    A taper such as Fejer's smoothly reduces higher harmonics, removing the overshoot at the cost of a softer edge.

Summary

  • Square: odd harmonics 4/(pi k); sawtooth: all harmonics 2(-1)^(k+1)/k; triangle: odd cosines -4/(pi k^2).
  • Smoother signals have faster-decaying coefficients: 1/k for jumps, 1/k^2 for corners.
  • The Gibbs phenomenon leaves a roughly 9 percent overshoot at jumps whatever the number of harmonics.
  • Tapering coefficients suppresses the ringing.

Next: Properties of Fourier Series