Explore modules

Fourier Series and Gibbs Phenomenon

Approximate a square wave and visualize the Gibbs Phenomenon.

Free theory article

Approximate a square wave and visualize the Gibbs Phenomenon.

Concept & interpretation

The Gibbs Phenomenon describes the peculiar manner in which the Fourier series of a piecewise continuously differentiable periodic function behaves at a jump discontinuity. Specifically, the partial sums of the Fourier series exhibit large oscillations near the jump, which overshoot the function's values. Even as the number of terms approaches infinity, this overshoot does not disappear; instead, the peak of the overshoot moves closer to the discontinuity but its height approaches a non-zero limit of approximately 8.949% of the jump.

Experiment

You can verify this in the Fourier Series and Gibbs Phenomenon module.

  1. Set the Amplitude A to 1.
  2. Set the Odd-term count N to 1.
  3. Set the Probe theta / pi to 0.5.
  4. Observe the partial sum is approximately 1.2732 and the peak overshoot is 13.66%.
  5. Now set Odd-term count N to 3. The peak moves to 0.167π, but the overshoot remains around 9.42%.
  6. Set Odd-term count N to 2 while Amplitude A = 1 and Probe theta / pi = 0.5. The sum is 8/(3π), about 0.848826363157, while the first peak is 8√2/(3π), about 1.20042175488.
  7. Set Odd-term count N to 20. The near-jump plot marks the first peak at theta / pi = 0.025 and computes its excess rather than forcing the limiting percentage.
  8. Set Probe theta / pi to 0, then -1 and 1. Target midpoint and sum are 0 at each jump. This convention does not mean the continuous finite sum reproduces the one-sided limits there.
  9. Set Amplitude A to 0. Target, sum, peak value and error are 0, while normalized overshoot is unavailable. Restore A = 1, clear Odd-term count N, observe the error and absent outputs, then restore N = 1.
Read the full free theory article