Skip to main content
Mathematics LibreTexts

5.5: Appendix- The Gibbs Phenomenon

  • Page ID
    106230
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    We have seen that when there is a jump discontinuity in the periodic extension of our functions, whether the function originally had a discontinuity or developed one due to a mismatch in the values of the endpoints. This can be seen in Figures 5.9, 5.11 and 5.13. The Fourier series has a difficult time converging at the point of discontinuity and these graphs of the Fourier series show a distinct overshoot which does not go away. This is called the Gibbs phenomenon and the amount of overshoot can be computed.

    In one of our first examples, Example 5.6, we found the Fourier series representation of the piecewise defined function

    \(f(x)=\left\{\begin{array}{c}
    1, \quad 0<x<\pi \\
    -1, \pi<x<2 \pi
    \end{array}\right.\)

    to be

    \[f(x) \sim \dfrac{4}{\pi} \sum_{k=1}^{\infty} \dfrac{\sin (2 k-1) x}{2 k-1} . \nonumber \]

    In Figure 5.14 we display the sum of the first ten terms. Note the wiggles, overshoots and under shoots near \(x=0, \pm \pi\). These are seen more when we plot the representation for \(x \in[-3 \pi, 3 \pi]\), as shown in Figure 5.15. We note that the overshoots and undershoots occur at discontinuities in the periodic extension of \(f(x)\). These occur whenever \(f(x)\) has a discontinuity or if the values of \(f(x)\) at the endpoints of the domain do not agree.

    One might expect that we only need to add more terms. In Figure 5.16 we show the sum for twenty terms. Note the sum appears to converge better for points far from the discontinuities. But, the overshoots and undershoots are still present. In Figures 5.17 and 5.18 show magnified plots of the overshoot at \(x=0\) for \(N=100\) and \(N=500\), respectively. We see that the overshoot persists. The peak is at about the same height, but its location seems to be getting closer to the origin. We will show how one can estimate the size of the overshoot.

    Screen Shot 2022-07-05 at 12.57.24 PM.png
    Figure 5.14. The Fourier series representation of a step function on \([−\pi, \pi]\) for \(N = 10\).

    We can study the Gibbs phenomenon by looking at the partial sums of general Fourier trigonometric series for functions \(f(x)\) defined on the interval \([−L, L]\). Writing out the partial sums, inserting the Fourier coefficients and rearranging, we have

    Screen Shot 2022-07-05 at 12.58.54 PM.png
    Figure 5.15. The Fourier series representation of a step function on \([−\pi, \pi]\) for \(N = 10\) plotted on \([−3\pi, 3\pi]\) displaying the periodicity.

    \(S_{N}(x)=a_{0}+\sum_{n=1}^{N}\left[a_{n} \cos \dfrac{n \pi x}{L}+b_{n} \sin \dfrac{n \pi x}{L}\right]\)

    Screen Shot 2022-07-05 at 1.00.15 PM.png
    Figure 5.16. The Fourier series representation of a step function on \([-\pi, \pi]\) for \(N=20\).
    Screen Shot 2022-07-05 at 1.01.25 PM.png
    Figure 5.17. The Fourier series representation of a step function on \([−\pi, \pi]\) for \(N = 100\).

    \[\begin{aligned}
    =& \dfrac{1}{2 L} \int_{-L}^{L} f(y) d y+\sum_{n=1}^{N}\left[\left(\dfrac{1}{L} \int_{-L}^{L} f(y) \cos \dfrac{n \pi y}{L} d y\right) \cos \dfrac{n \pi x}{L}\right.\\
    &\left.+\left(\dfrac{1}{L} \int_{-L}^{L} f(y) \sin \dfrac{n \pi y}{L} d y\right) \sin \dfrac{n \pi x}{L}\right] \\
    =& \dfrac{1}{L} \int_{-L}^{L}\left\{\dfrac{1}{2}+\sum_{n=1}^{N}\left(\cos \dfrac{n \pi y}{L} \cos \dfrac{n \pi x}{L}+\sin \dfrac{n \pi y}{L} \sin \dfrac{n \pi x}{L}\right)\right\} f(y) d y \\
    =& \dfrac{1}{L} \int_{-L}^{L}\left\{\dfrac{1}{2}+\sum_{n=1}^{N} \cos \dfrac{n \pi(y-x)}{L}\right\} f(y) d y \\
    \equiv & \dfrac{1}{L} \int_{-L}^{L} D_{N}(y-x) f(y) d y .
    \end{aligned} \label{5.67} \]

    We have defined

    \[D_{N}(x)=\dfrac{1}{2}+\sum_{n=1}^{N} \cos \dfrac{n \pi x}{L}, \nonumber \]

    which is called the \(N\)-th Dirichlet Kernel. We now prove

    Screen Shot 2022-07-05 at 1.04.10 PM.png
    Figure 5.18. The Fourier series representation of a step function on \([−\pi, \pi]\) for \(N = 500\).

    Proposition:

    \[D_{n}(x)= \begin{cases}\dfrac{\sin \left(\left(n+\dfrac{1}{2}\right) \dfrac{\pi x}{L}\right)}{2 \sin \dfrac{\pi x}{2 L}}, & \sin \dfrac{\pi x}{2 L} \neq 0 \\ n+\dfrac{1}{2}, & \sin \dfrac{\pi x}{2 L}=0\end{cases} \nonumber \]

    Proof: Let \(\theta=\dfrac{\pi x}{L}\) and multiply \(D_{n}(x)\) by \(2 \sin \dfrac{\theta}{2}\) to obtain:

    \[\begin{aligned}
    2 \sin \dfrac{\theta}{2} D_{n}(x)=& 2 \sin \dfrac{\theta}{2}\left[\dfrac{1}{2}+\cos \theta+\cdots+\cos n \theta\right] \\
    =& \sin \dfrac{\theta}{2}+2 \cos \theta \sin \dfrac{\theta}{2}+2 \cos 2 \theta \sin \dfrac{\theta}{2}+\cdots+2 \cos n \theta \sin \dfrac{\theta}{2} \\
    =& \sin \dfrac{\theta}{2}+\left(\sin \dfrac{3 \theta}{2}-\sin \dfrac{\theta}{2}\right)+\left(\sin \dfrac{5 \theta}{2}-\sin \dfrac{3 \theta}{2}\right)+\cdots \\
    &+\left[\sin \left(n+\dfrac{1}{2}\right) \theta-\sin \left(n-\dfrac{1}{2}\right) \theta\right] \\
    =& \sin \left(n+\dfrac{1}{2}\right) \theta
    \end{aligned} \label{5.68} \]

    Thus,

    \[2 \sin \dfrac{\theta}{2} D_{n}(x)=\sin \left(n+\dfrac{1}{2}\right) \theta \nonumber \]

    or if \(\sin \dfrac{\theta}{2} \neq 0\)

    \[D_{n}(x)=\dfrac{\sin \left(n+\dfrac{1}{2}\right) \theta}{2 \sin \dfrac{\theta}{2}}, \quad \theta=\dfrac{\pi x}{L} \nonumber \]

    If \(\sin \dfrac{\theta}{2}=0\), then one needs to apply L'Hospital's Rule:

    \[\begin{aligned}
    \lim _{\theta \rightarrow 2 m \pi} \dfrac{\sin \left(n+\dfrac{1}{2}\right) \theta}{2 \sin \dfrac{\theta}{2}} &=\lim _{\theta \rightarrow 2 m \pi} \dfrac{\left(n+\dfrac{1}{2}\right) \cos \left(n+\dfrac{1}{2}\right) \theta}{\cos \dfrac{\theta}{2}} \\
    &=\dfrac{\left(n+\dfrac{1}{2}\right) \cos (2 m n \pi+m \pi)}{\cos m \pi} \\
    &=n+\dfrac{1}{2} .
    \end{aligned} \label{5.69} \]

    We further note that \(D_{N}(x)\) is periodic with period \(2 L\) and is an even function.

    So far, we have found that

    \[S_{N}(x)=\dfrac{1}{L} \int_{-L}^{L} D_{N}(y-x) f(y) d y \label{5.70} \]

    Now, make the substitution \(\xi=y-x\). Then,

    \[\begin{aligned}
    S_{N}(x) &=\dfrac{1}{L} \int_{-L-x}^{L-x} D_{N}(\xi) f(\xi+x) d \xi \\
    &=\dfrac{1}{L} \int_{-L}^{L} D_{N}(\xi) f(\xi+x) d \xi
    \end{aligned} \label{5.71} \]

    In the second integral we have made use of the fact that \(f(x)\) and \(D_{N}(x)\) are periodic with period \(2 L\) and shifted the interval back to \([-L, L]\).

    Now split the integration and use the fact that \(D_{N}(x)\) is an even function. Then,

    \[\begin{aligned}
    S_{N}(x) &=\dfrac{1}{L} \int_{-L}^{0} D_{N}(\xi) f(\xi+x) d \xi+\dfrac{1}{L} \int_{0}^{L} D_{N}(\xi) f(\xi+x) d \xi \\
    &=\dfrac{1}{L} \int_{0}^{L}[f(x-\xi)+f(\xi+x)] D_{N}(\xi) d \xi
    \end{aligned} \label{5.72} \]

    We can use this result to study the Gibbs phenomenon whenever it occurs. In particular, we will only concentrate on our earlier example. Namely,

    \(f(x)=\left\{\begin{array}{c}
    1, \quad 0<x<\pi \\
    -1, \pi<x<2 \pi
    \end{array}\right.\)

    For this case, we have

    \[S_{N}(x)=\dfrac{1}{\pi} \int_{0}^{\pi}[f(x-\xi)+f(\xi+x)] D_{N}(\xi) d \xi \label{5.73} \]

    for

    \[D_{N}(x)=\dfrac{1}{2}+\sum_{n=1}^{N} \cos n x . \nonumber \]

    Also, one can show that

    \(f(x-\xi)+f(\xi+x)=\left\{\begin{array}{c}
    2, \quad 0 \leq \xi<x \\
    0, \quad x \leq \xi<\pi-x \\
    -2, \pi-x \leq \xi<\pi
    \end{array}\right.\)

    Thus, we have

    \[\begin{aligned}
    S_{N}(x) &=\dfrac{2}{\pi} \int_{0}^{x} D_{N}(\xi) d \xi-\dfrac{2}{\pi} \int_{\pi-x}^{\pi} D_{N}(\xi) d \xi \\
    &=\dfrac{2}{\pi} \int_{0}^{x} D_{N}(z) d z+\dfrac{2}{\int_{0}^{x}} D_{N}(\pi-z) d z
    \end{aligned} \label{5.74} \]

    Here we made the substitution \(z=\pi-\xi\) in the second integral. The Dirichlet kernel in the proposition for \(L=\pi\) is given by

    \[D_{N}(x)=\dfrac{\sin \left(N+\dfrac{1}{2}\right) x}{2 \sin \dfrac{x}{2}} . \nonumber \]

    For \(N\) large, we have \(N+\dfrac{1}{2} \approx N\), and for small \(x\), we have \(\sin \dfrac{x}{2} \approx \dfrac{x}{2}\). So, under these assumptions,

    \[D_{N}(x) \approx \dfrac{\sin N x}{x} . \nonumber \]

    Therefore,

    \[S_{N}(x) \rightarrow \dfrac{2}{\pi} \int_{0}^{x} \dfrac{\sin N \xi}{\xi} d \xi \nonumber \]

    If we want to determine the locations of the minima and maxima, where the undershoot and overshoot occur, then we apply the first derivative test for extrema to \(S_{N}(x)\). Thus,

    \[\dfrac{d}{d x} S_{N}(x)=\dfrac{2}{\pi} \dfrac{\sin N x}{x}=0 . \nonumber \]

    The extrema occur for \(N x=m \pi, m=\pm 1, \pm 2, \ldots\) One can show that there is a maximum at \(x=\pi / N\) and a minimum for \(x=2 \pi / N\). The value for the overshoot can be computed as

    \[\begin{aligned}
    S_{N}(\pi / N) &=\dfrac{2}{\pi} \int_{0}^{\pi / N} \dfrac{\sin N \xi}{\xi} d \xi \\
    &=\dfrac{2}{\pi} \int_{0}^{\pi} \dfrac{\sin t}{t} d t \\
    &=\dfrac{2}{\pi} \operatorname{Si}(\pi) \\
    &=1.178979744 \ldots
    \end{aligned} \label{5.75} \]

    Note that this value is independent of \(N\) and is given in terms of the sine integral,

    \[\operatorname{Si}(x) \equiv \int_{0}^{x} \dfrac{\sin t}{t} d t \nonumber \]


    This page titled 5.5: Appendix- The Gibbs Phenomenon is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?