Definitions

# Gibbs phenomenon

In mathematics, the Gibbs phenomenon (also known as ringing artifacts), named after the American physicist J. Willard Gibbs, is the peculiar manner in which the Fourier series of a piecewise continuously differentiable periodic function f behaves at a jump discontinuity: the nth partial sum of the Fourier series has large oscillations near the jump, which might increase the maximum of the partial sum above that of the function itself. The overshoot does not die out as the frequency increases, but approaches a finite limit.

## Description

The three pictures on the right demonstrate the phenomenon for a square wave whose Fourier expansion is

$sin\left(x\right)+frac\left\{1\right\}\left\{3\right\}sin\left(3x\right)+frac\left\{1\right\}\left\{5\right\}sin\left(5x\right)+dotsb$

More precisely, this is the function f which equals $pi/4$ between $2npi$ and $\left(2n+1\right)pi$ and $-pi/4$ between $\left(2n+1\right)pi$ and $\left(2n+2\right)pi$ for every integer n; thus this square wave has a jump discontinuity of height $pi/2$ at every integer multiple of $pi$.

As can be seen, as the number of terms rises, the error of the approximation is reduced in width and energy, but converges to a fixed height. A calculation for the square wave (see Zygmund, chap. 8.5., or the computations at the end of this article) gives an explicit formula for the limit of the height of the error. It turns out that the Fourier series exceeds the height $pi/4$ of the square wave by

$frac\left\{1\right\}\left\{2\right\}int_0^pi frac\left\{sin t\right\}\left\{t\right\}, dt - frac\left\{pi\right\}\left\{4\right\} = frac\left\{pi\right\}\left\{2\right\}cdot \left(0.089490dots\right)$

or about 9 percent. More generally, at any jump point of a piecewise continuously differentiable function with a jump of a, the nth partial Fourier series will (for n very large) overshoot this jump by approximately $a cdot \left(0.089490dots\right)$ at one end and undershoot it by the same amount at the other end; thus the "jump" in the partial Fourier series will be about 18% larger than the jump in the original function. At the location of the discontinuity itself, the partial Fourier series will converge to the midpoint of the jump (regardless of what the actual value of the original function is at this point). The quantity

$int_0^pi frac\left\{sin t\right\}\left\{t\right\} dt = \left(1.851937052dots\right) = frac\left\{pi\right\}\left\{2\right\} + pi cdot \left(0.089490dots\right)$
is sometimes known as the Wilbraham-Gibbs constant.

The Gibbs phenomenon was first noticed and analyzed by the obscure Henry Wilbraham. He published a paper on it in 1848 that went unnoticed by the mathematical world. It was not until Albert Michelson observed the phenomenon via a mechanical graphing machine that interest arose. Michelson developed a device in 1898 that could compute and re-synthesize the Fourier series. When the Fourier coefficients for a square wave were input to the machine, the graph would oscillate at the discontinuities. This would continue to occur even as the number of Fourier coefficients increased.

Because it was a physical device subject to manufacturing flaws, Michelson was convinced that the overshoot was caused by errors in the machine. In 1898 J. Willard Gibbs published a paper on Fourier series in which he discussed the example of what today would be called a sawtooth wave, and described the graph obtained as a limit of the graphs of the partial sums of the Fourier series. Interestingly in this paper he failed to notice the phenomenon that bears his name, and the limit he described was incorrect. In 1899 he published a correction to his paper in which he describes the phenomenon and points out the important distinction between the limit of the graphs and the graph of the function that is the limit of the partial sums of the Fourier series. Maxime Bôcher gave a detailed mathematical analysis of the phenomenon in 1906 and named it the Gibbs phenomenon.

Informally, it reflects the difficulty inherent in approximating a discontinuous function by a finite series of continuous sine and cosine waves. It is important to put emphasis on the word finite because even though every partial sum of the Fourier series overshoots the function it is approximating, the limit of the partial sums do not exhibit the same overshoot. In fact, for a piecewise C1 function the Fourier series will converge to the function at every point except at jump discontinuities. At jump the discontinuities the limit will converge to the average of the values of the function on either side of the the jump. This is a consequences of the Dirichlet-Jordan theorem . The Gibbs phenomenon is also closely related to the principle that the decay of the Fourier coefficients of a function at infinity is controlled by the smoothness of that function; very smooth functions will have very rapidly decaying Fourier coefficients (resulting in the rapid convergence of the Fourier series), whereas discontinuous functions will have very slowly decaying Fourier coefficients (causing the Fourier series to converge very slowly). Note for instance that the Fourier coefficients $1, 1/3, 1/5, dots$ of the discontinuous square wave described above decay only as fast as the harmonic series, which is not absolutely convergent; indeed, the above Fourier series turns out to be only conditionally convergent for almost every value of x. This provides a partial explanation of the Gibbs phenomenon, since Fourier series with absolutely convergent Fourier coefficients would be uniformly convergent by the Weierstrass M-test and would thus be unable to exhibit the above oscillatory behavior. By the same token, it is impossible for a discontinuous function to have absolutely convergent Fourier coefficients, since the function would thus be the uniform limit of continuous functions and therefore be continuous, a contradiction. See more about absolute convergence of Fourier series.

In practice, the difficulties associated with the Gibbs phenomenon can be ameliorated by using a smoother method of Fourier series summation, such as Fejér summation or Riesz summation, or by using sigma-approximation. Using a wavelet transform with Haar basis functions, the Gibbs phenomenon does not occur.

## Formal mathematical description of the phenomenon

Let $f: \left\{Bbb R\right\} to \left\{Bbb R\right\}$ be a piecewise continuously differentiable function which is periodic with some period $L > 0$. Suppose that at some point $x_0$, the left limit $f\left(x_0^-\right)$ and right limit $f\left(x_0^+\right)$ of the function $f$ differ by a non-zero gap $a$:

$f\left(x_0^+\right) - f\left(x_0^-\right) = a neq 0.$

For each positive integer N ≥ 1, let SN f be the Nth partial Fourier series

$S_N f\left(x\right) := sum_\left\{-N leq n leq N\right\} hat f\left(n\right) e^\left\{2pi i n x/L\right\}$

# frac{1}{2} a_0 + sum_{n

1}^N left(a_n cosleft(frac{2pi nx}{L}right) + b_n sinleft(frac{2pi nx}{L}right) right)

where the Fourier coefficients $hat f\left(n\right), a_n, b_n$ are given by the usual formulae

$hat f\left(n\right) := frac\left\{1\right\}\left\{L\right\} int_0^L f\left(x\right) e^\left\{-2pi i n x/L\right\}, dx$

$a_n := frac\left\{2\right\}\left\{L\right\} int_0^L f\left(x\right) cosleft\left(frac\left\{2pi nx\right\}\left\{L\right\}right\right), dx$

$b_n := frac\left\{2\right\}\left\{L\right\} int_0^L f\left(x\right) sinleft\left(frac\left\{2pi nx\right\}\left\{L\right\}right\right), dx.$

Then we have

$lim_\left\{N to infty\right\} S_N fleft\left(x_0 + frac\left\{L\right\}\left\{2N\right\}right\right) = f\left(x_0^+\right) + acdot \left(0.089490dots\right)$

and

$lim_\left\{N to infty\right\} S_N fleft\left(x_0 - frac\left\{L\right\}\left\{2N\right\}right\right) = f\left(x_0^-\right) - acdot \left(0.089490dots\right)$

but

$lim_\left\{N to infty\right\} S_N f\left(x_0\right) = frac\left\{f\left(x_0^-\right) + f\left(x_0^+\right)\right\}\left\{2\right\}.$
More generally, if $x_N$ is any sequence of real numbers which converges to $x_0$ as $N to infty$, and if the gap a is positive then
$limsup_\left\{N to infty\right\} S_N f\left(x_N\right) leq f\left(x_0^+\right) + acdot \left(0.089490dots\right)$
and
$liminf_\left\{N to infty\right\} S_N f\left(x_N\right) geq f\left(x_0^-\right) - acdot \left(0.089490dots\right)$
If instead the gap a is negative, one needs to interchange limit superior with limit inferior, and also interchange the ≤ and ≥ signs, in the above two inequalities.

## The square wave example

We now illustrate the above Gibbs phenomenon in the case of the square wave described earlier. In this case the period L is $2pi$, the discontinuity $x_0$ is at zero, and the jump a is equal to $pi/2$. For simplicity let us just deal with the case when N is even (the case of odd N is very similar). Then we have

$S_N f\left(x\right) = sin\left(x\right) + frac\left\{1\right\}\left\{3\right\} sin\left(3x\right) + cdots + frac\left\{1\right\}\left\{N-1\right\} sin\left(\left(N-1\right)x\right).$

Substituting $x=0$, we obtain

$S_N f\left(0\right) = 0 = frac\left\{-frac\left\{pi\right\}\left\{4\right\} + frac\left\{pi\right\}\left\{4\right\}\right\}\left\{2\right\} = frac\left\{f\left(0^-\right) + f\left(0^+\right)\right\}\left\{2\right\}$

as claimed above. Next, we compute

$S_N f\left(frac\left\{2pi\right\}\left\{2N\right\}\right) = sinleft\left(frac\left\{pi\right\}\left\{N\right\}right\right) + frac\left\{1\right\}\left\{3\right\} sinleft\left(frac\left\{3pi\right\}\left\{N\right\}right\right)$
+ cdots + frac{1}{N-1} sinleft(frac{(N-1)pi}{N} right).

If we introduce the normalized sinc function, $operatorname\left\{sinc\right\}\left(x\right),$, we can rewrite this as

$S_N fleft\left(frac\left\{2pi\right\}\left\{2N\right\}right\right) = frac\left\{pi\right\}\left\{2\right\} left\left[frac\left\{2\right\}\left\{N\right\} operatorname\left\{sinc\right\}left\left(frac\left\{1\right\}\left\{N\right\}right\right) + frac\left\{2\right\}\left\{N\right\} operatorname\left\{sinc\right\}left\left(frac\left\{3\right\}\left\{N\right\}right\right)$
+ cdots + frac{2}{N} operatorname{sinc}left(frac{(N-1)}{N} right) right].

But the expression in square brackets is a numerical integration approximation to the integral $int_0^1 operatorname\left\{sinc\right\}\left(x\right) dx$ (more precisely, it is a midpoint rule approximation with spacing $2/N$). Since the sinc function is continuous, this approximation converges to the actual integral as $N to infty$. Thus we have

 $lim_\left\{N to infty\right\} S_N fleft\left(frac\left\{2pi\right\}\left\{2N\right\}right\right)$ $= frac\left\{pi\right\}\left\{2\right\} int_0^1 operatorname\left\{sinc\right\}\left(x\right) dx$ $= frac\left\{1\right\}\left\{2\right\} int_\left\{x=0\right\}^1 frac\left\{sin\left(pi x\right)\right\}\left\{pi x\right\} d\left(pi x\right)$ $= frac\left\{1\right\}\left\{2\right\} int_0^pi frac\left\{sin\left(t\right)\right\}\left\{t\right\} dt quad = quad frac\left\{pi\right\}\left\{4\right\} + frac\left\{pi\right\}\left\{2\right\} cdot \left(0.089490dots\right)$

which was what was claimed in the previous section. A similar computation shows

$lim_\left\{N to infty\right\} S_N fleft\left(-frac\left\{2pi\right\}\left\{2N\right\}right\right) = -frac\left\{pi\right\}\left\{2\right\} int_0^1 operatorname\left\{sinc\right\}\left(x\right) dx = -frac\left\{pi\right\}\left\{4\right\} -$
frac{pi}{2} cdot (0.089490dots).

## Consequences

The Gibbs phenomenon causes a compression artifact called pre-echo in audio compression algorithms that use Fourier-related transforms – particularly the modified discrete cosine transform (MDCT) – such as MP3, MPEG-4 AAC, and Vorbis.

## Publications

• Gibbs, J. W., "Fourier Series". Nature 59, 200 (1898) and 606 (1899).
• Antoni Zygmund, Trigonometrical series, Dover publications, 1955.
• Wilbraham, H. On a certain periodic function, Cambridge and Dublin Math. J., 3 (1848), pp. 198-201.
• Paul J. Nahin, Dr. Euler's Fabulous Formula, Princeton University Press, 2006. Ch. 4, Sect. 4.