The Ringing That Never Dies
Round sine waves are layered to build a sharp square wave.
More terms press the flat parts onto the wave. But the ringing beside each jump does not shrink. No number of terms removes that bump.
For example, zoom into a π’ building in a π· photo. Smaller pixels sharpen the shape. Yet the jagged marks along the edges stay to the end.
S N ( x ) = 4 Ο β k = 1 N sin β‘ ( ( 2 k β 1 ) x ) 2 k β 1 S_N(x) = \frac{4}{\pi}\sum_{k=1}^{N} \frac{\sin((2k-1)x)}{2k-1} S N β ( x ) = Ο 4 β k = 1 β N β 2 k β 1 sin (( 2 k β 1 ) x ) β
Examples & Exercises
Compute the sine-series coefficients b 2 k β 1 = 4 Ο ( 2 k β 1 ) b_{2k-1} = \frac{4}{\pi(2k-1)} b 2 k β 1 β = Ο ( 2 k β 1 ) 4 β of the square wave by direct integration.
b n = 2 Ο β« 0 Ο sin β‘ ( n x ) β d x = 2 ( 1 β cos β‘ n Ο ) n Ο b_n = \frac{2}{\pi}\int_0^{\pi} \sin(nx)\,dx = \frac{2(1-\cos n\pi)}{n\pi} b n β = Ο 2 β β« 0 Ο β sin ( n x ) d x = nΟ 2 ( 1 β cos nΟ ) β
N = 5 N = 5 N = 5 : the first 5 odd harmonics mimic the step.
Show proof
The square wave is odd on ( β Ο , Ο ) (-\pi, \pi) ( β Ο , Ο ) , so cosine coefficients vanish and b n = 1 Ο β« β Ο Ο f ( x ) sin β‘ ( n x ) β d x = 2 Ο β« 0 Ο sin β‘ ( n x ) β d x b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)\,dx = \frac{2}{\pi}\int_0^{\pi}\sin(nx)\,dx b n β = Ο 1 β β« β Ο Ο β f ( x ) sin ( n x ) d x = Ο 2 β β« 0 Ο β sin ( n x ) d x .
Integrating gives 2 n Ο ( 1 β cos β‘ n Ο ) \frac{2}{n\pi}(1 - \cos n\pi) nΟ 2 β ( 1 β cos nΟ ) : 0 0 0 for even n n n , 4 n Ο \frac{4}{n\pi} nΟ 4 β for odd n n n .
So b 2 k β 1 = 4 Ο ( 2 k β 1 ) b_{2k-1} = \frac{4}{\pi(2k-1)} b 2 k β 1 β = Ο ( 2 k β 1 ) 4 β and b 2 k = 0 b_{2k} = 0 b 2 k β = 0 .
Verify numerically that the peak near the jump tends to β 1.179 \approx 1.179 β 1.179 , i.e. about 9% of the jump.
(Numerical check)
max β‘ S N β 2 β S i ( Ο ) Ο β 1.17898 \max S_N \to \frac{2\,\mathrm{Si}(\pi)}{\pi} \approx 1.17898 max S N β β Ο 2 Si ( Ο ) β β 1.17898
N = 50 N = 50 N = 50 : peak β 1.179 \approx 1.179 β 1.179 β overshooting 1 by 0.179 0.179 0.179 .
Show proof
Measuring the peak just right of the jump at N = 50 N = 50 N = 50 gives β 1.179 \approx 1.179 β 1.179 (theory: 2 β S i ( Ο ) Ο β 1.17898 \frac{2\,\mathrm{Si}(\pi)}{\pi} \approx 1.17898 Ο 2 Si ( Ο ) β β 1.17898 ).
The jump size is 2 2 2 , so the excess 0.179 0.179 0.179 above 1 1 1 is about 8.95 % 8.95\% 8.95% of the jump.
This fraction does not go to 0 as N N N grows β that is the Gibbs phenomenon. (Verified numerically; the rigorous proof is omitted.)
Show algebraically that S N S_N S N β at x = Ο / 2 x = \pi/2 x = Ο /2 becomes the Leibniz series.
S N ββ£ ( Ο 2 ) = 4 Ο β k = 1 N ( β 1 ) k + 1 2 k β 1 β 1 S_N\!\left(\tfrac{\pi}{2}\right) = \frac{4}{\pi}\sum_{k=1}^{N}\frac{(-1)^{k+1}}{2k-1} \to 1 S N β ( 2 Ο β ) = Ο 4 β k = 1 β N β 2 k β 1 ( β 1 ) k + 1 β β 1
At x = Ο / 2 x = \pi/2 x = Ο /2 the partial sum is 4 Ο \frac{4}{\pi} Ο 4 β times the Leibniz partial sum.
Show proof
Since sin β‘ ( ( 2 k β 1 ) Ο 2 ) = ( β 1 ) k + 1 \sin\left((2k-1)\frac{\pi}{2}\right) = (-1)^{k+1} sin ( ( 2 k β 1 ) 2 Ο β ) = ( β 1 ) k + 1 , S N ( Ο / 2 ) = 4 Ο β k = 1 N ( β 1 ) k + 1 2 k β 1 S_N(\pi/2) = \frac{4}{\pi}\sum_{k=1}^{N}\frac{(-1)^{k+1}}{2k-1} S N β ( Ο /2 ) = Ο 4 β β k = 1 N β 2 k β 1 ( β 1 ) k + 1 β .
As N β β N \to \infty N β β , the bracket tends to the Leibniz series Ο 4 \frac{\pi}{4} 4 Ο β β grounded as follows (verified in the series chapter): the terms 1 2 k β 1 \frac{1}{2k-1} 2 k β 1 1 β decrease to 0 0 0 , so the Leibniz (alternating series) test gives convergence, and the value Ο 4 \frac{\pi}{4} 4 Ο β is the arctan β‘ \arctan arctan series evaluated at x = 1 x = 1 x = 1 .
Hence S N ( Ο / 2 ) β 4 Ο β
Ο 4 = 1 S_N(\pi/2) \to \frac{4}{\pi}\cdot\frac{\pi}{4} = 1 S N β ( Ο /2 ) β Ο 4 β β
4 Ο β = 1 , matching the square wave's value.
9. Series of Functions & Fourier