# Explanation

We begin this discussion by taking a signal with a finite number of discontinuities (like a square pulse) and finding its Fourier Series representation. We then attempt to reconstruct it from these Fourier coefficients. What we find is that the more coefficients we use, the more the signal begins to resemble the original. However, around the discontinuities, we observe rippling that does not seem to subside. As we consider even more coefficients, we notice that the ripples narrow, but do not shorten. As we approach an infinite number of coefficients, this rippling still does not go away. This is when we apply the idea of almost everywhere. While these ripples remain (never dropping below 9% of the pulse height), the area inside them tends to zero, meaning that the energy of this ripple goes to zero. This means that their width is approaching zero and we can assert that the reconstruction is exactly the original except at the points of discontinuity. Since the Dirichlet conditions assert that there may only be a finite number of discontinuities, we can conclude that the principle of almost everywhere is met. This phenomenon is a specific case of nonuniform convergence.

Below we will use the square wave, along with its Fourier Series representation, and show several figures that reveal this phenomenon more mathematically.

# Square Wave

The Fourier series representation of a square signal below says that the left and right sides are "equal." In order to understand Gibbs Phenomenon we will need to redefine the way we look at equality.

Figure 1 shows several Fourier series approximations of the square wave using a varied number of terms, denoted by $K$:

When comparing the square wave to its Fourier series
representation in Figure 1,
it is not clear that the two are equal. The fact that the
square wave's Fourier series requires more terms for a given
representation accuracy is not important. However, close
inspection of Figure 1 does
reveal a potential issue: Does the Fourier series really
equal the square wave at **all** values of
$t$? In
particular, at each step-change in the square wave, the
Fourier series exhibits a peak followed by rapid
oscillations. As more terms are added to the series, the
oscillations seem to become more rapid and smaller, but the
peaks are not decreasing. Consider this mathematical
question intuitively: Can a discontinuous function, like the
square wave, be expressed as a sum, even an infinite one, of
continuous ones? One should at least be suspicious, and in
fact, it can't be thus expressed. This issue brought
Fourier much criticism from the French Academy of
Science (Laplace, Legendre, and Lagrange comprised the
review committee) for several years after its presentation
on 1807. It was not resolved for also a century, and its
resolution is interesting and important to understand from a
practical viewpoint.

The extraneous peaks in the square wave's Fourier series
**never** disappear; they are termed
Gibb's phenomenon after the American physicist
Josiah Willard Gibbs. They occur whenever the signal is
discontinuous, and will always be present whenever the
signal has jumps.

# Redefine Equality

Let's return to the question of equality; how can the equal
sign in the definition
of the Fourier series be justified? The partial
answer is that pointwise--each and every value of
$t$--equality is
**not** guaranteed. What mathematicians
later in the nineteenth century showed was that the rms
error of the Fourier series was always zero.

**zero**integral! It is through the eyes of the rms value that we define equality: Two signals ${s}_{1}\left(t\right)$, ${s}_{2}\left(t\right)$ are said to be equal in the mean square if $\mathrm{rms}\left({s}_{1}-{s}_{2}\right)=0$. These signals are said to be equal pointwise if ${s}_{1}\left(t\right)={s}_{2}\left(t\right)$ for all values of $t$. For Fourier series, Gibb's phenomenon peaks have finite height and zero width: The error differs from zero only at isolated points--whenever the periodic signal contains discontinuities--and equals about 9% of the size of the discontinuity. The value of a function at a finite set of points does not affect its integral. This effect underlies the reason why defining the value of a discontinuous function at its discontinuity is meaningless. Whatever you pick for a value has no practical relevance for either the signal's spectrum or for how a system responds to the signal. The Fourier series value "at" the discontinuity is the average of the values on either side of the jump.