Gibbs phenomenon

In mathematics, the Gibbs phenomenon is the oscillatory behavior of the Fourier series of a piecewise continuously differentiable periodic function around a jump discontinuity. The N {\textstyle N} partial Fourier series of the function (formed by summing the N {\textstyle N} lowest constituent sinusoids of the Fourier series of the function) produces large peaks around the jump which overshoot and undershoot the function values. As more sinusoids are used, this approximation error approaches a limit of about 9% of the jump, though the infinite Fourier series sum does eventually converge almost everywhere.
The Gibbs phenomenon was observed by experimental physicists and was believed to be due to imperfections in the measuring apparatus, but it is in fact a mathematical result. It is one cause of ringing artifacts in signal processing. It is named after Josiah Willard Gibbs.
The Gibbs phenomenon is a behavior of the Fourier series of a function with a jump discontinuity and is described as the following:
At the jump point, the Fourier series gives the average of the function's both side limits toward the point.
The three pictures on the right demonstrate the Gibbs phenomenon for a square wave (with peak-to-peak amplitude of c {\textstyle c} from − c / 2 {\textstyle -c/2} to c / 2 {\textstyle c/2} and the periodicity L {\textstyle L} ) whose N {\textstyle N} partial Fourier series is 2 c π ( sin ⁡ ( ω x ) + 1 3 sin ⁡ ( 3 ω x ) + ⋯ + 1 2 N − 1 sin ⁡ ( ( 2 N − 1 ) ω x ) ) {\displaystyle {\frac {2c}{\pi }}\left(\sin(\omega x)+{\frac {1}{3}}\sin(3\omega x)+\cdots +{\frac {1}{2N-1}}\sin((2N-1)\omega x)\right)}
where ω = 2 π / L {\textstyle \omega =2\pi /L} . More precisely, this square wave is the function f ( x ) {\textstyle f(x)} which equals c 2 {\displaystyle {\tfrac {c}{2}}} between 2 n ( L / 2 ) {\textstyle 2n(L/2)} and ( 2 n + 1 ) ( L / 2 ) {\textstyle (2n+1)(L/2)} and − c 2 {\textstyle -{\tfrac {c}{2}}} between ( 2 n + 1 ) ( L / 2 ) {\textstyle (2n+1)(L/2)} and ( 2 n + 2 ) ( L / 2 ) {\textstyle (2n+2)(L/2)} for every integer n {\textstyle n} ; thus, this square wave has a jump discontinuity of peak-to-peak height c {\textstyle c} at every integer multiple of L / 2 {\textstyle L/2} .
As more sinusoidal terms are added (i.e., increasing N {\textstyle N} ), the error of the partial Fourier series converges to a fixed height. But because the width of the error continues to narrow, the area of the error – and hence the energy of the error – converges to 0. The square wave analysis reveals that the error exceeds the height (from zero) c 2 {\displaystyle {\tfrac {c}{2}}} of the square wave by c π ∫ 0 π sin ⁡ ( t ) t d t − c 2 = c ⋅ ( 0.089489872236 … ) . {\displaystyle {\frac {c}{\pi }}\int _{0}^{\pi }{\frac {\sin(t)}{t}}\ dt-{\frac {c}{2}}=c\cdot (0.089489872236\dots ).} (OEIS: A243268)
or about 9% of the full jump c {\textstyle c} . More generally, at any discontinuity of a piecewise continuously differentiable function with a jump of c {\textstyle c} , the N {\textstyle N} partial Fourier series of the function will (for a very large N {\textstyle N} value) overshoot this jump by an error approaching c ⋅ ( 0.089489872236 … ) {\textstyle c\cdot (0.089489872236\dots )} at one end and undershoot it by the same amount at the other end; thus the "full jump" in the partial Fourier series will be about 18% larger than the full jump in the original function. At the discontinuity, the partial Fourier series will converge to the midpoint of the jump (regardless of the actual value of the original function at the discontinuity) as a consequence of Dirichlet's theorem. The quantity ∫ 0 π sin ⁡ t t d t = ( 1.851937051982 … ) = π 2 + π ⋅ ( 0.089489872236 … ) {\displaystyle \int _{0}^{\pi }{\frac {\sin t}{t}}\ dt=(1.851937051982\dots )={\frac {\pi }{2}}+\pi \cdot (0.089489872236\dots )} (OEIS: A036792) is sometimes known as the Wilbraham–Gibbs constant.
The Gibbs phenomenon was first noticed and analyzed by Henry Wilbraham in an 1848 paper. The paper attracted little attention until 1914 when it was mentioned in Heinrich Burkhardt's review of mathematical analysis in Klein's encyclopedia. In 1898, Albert A. Michelson developed a device that could compute and re-synthesize the Fourier series. A widespread anecdote says that when the Fourier coefficients for a square wave were input to the machine, the graph would oscillate at the discontinuities, and that because it was a physical device subject to manufacturing flaws, Michelson was convinced that the overshoot was caused by errors in the machine. In fact the graphs produced by the machine were not good enough to exhibit the Gibbs phenomenon clearly, and Michelson may not have noticed it as he made no mention of this effect in his paper (Michelson & Stratton 1898) about his machine or his later letters to Nature.
Inspired by correspondence in Nature between Michelson and A. E. H. Love about the convergence of the Fourier series of the square wave function, J. Willard Gibbs published a note in 1898 pointing out the important distinction between the limit of the graphs of the partial sums of the Fourier series of a sawtooth wave and the graph of the limit of those partial sums. In his first letter Gibbs failed to notice the Gibbs phenomenon, and the limit that he described for the graphs of the partial sums was inaccurate. In 1899 he published a correction in which he described the overshoot at the point of discontinuity (Nature, April 27, 1899, p. 606). In 1906, Maxime Bôcher gave a detailed mathematical analysis of that overshoot, coining the term "Gibbs phenomenon" and bringing it into widespread use.
After the existence of Henry Wilbraham's paper became widely known, in 1925 Horatio Scott Carslaw remarked, "We may still call this property of Fourier's series (and certain other series) Gibbs's phenomenon; but we must no longer claim that the property was first discovered by Gibbs."
Informally, the Gibbs phenomenon reflects the difficulty inherent in approximating a discontinuous function by a finite series of continuous sinusoidal waves. It is important to put emphasis on the word finite, because even though every partial sum of the Fourier series overshoots around each discontinuity it is approximating, the limit of summing an infinite number of sinusoidal waves does not. The overshoot peaks moves closer and closer to the discontinuity as more terms are summed, so convergence is possible.
There is no contradiction (between the overshoot error converging to a non-zero height even though the infinite sum has no overshoot), because the overshoot peaks move toward the discontinuity. The Gibbs phenomenon thus exhibits pointwise convergence, but not uniform convergence. For a piecewise continuously differentiable (class C) function, the Fourier series converges to the function at every point except at jump discontinuities. At jump discontinuities, the infinite sum will converge to the jump discontinuity's midpoint (i.e. the average of the values of the function on either side of the jump), as a consequence of Dirichlet's theorem.
The Gibbs phenomenon is closely related to the principle that the smoothness of a function controls the decay rate of its Fourier coefficients. Fourier coefficients of smoother functions will more rapidly decay (resulting in faster convergence), whereas Fourier coefficients of discontinuous functions will slowly decay (resulting in slower convergence). For example, the discontinuous square wave has Fourier coefficients ( 1 1 , 0 , 1 3 , 0 , 1 5 , 0 , 1 7 , 0 , 1 9 , 0 , … ) {\displaystyle ({\tfrac {1}{1}},{\scriptstyle {\text{0}}},{\tfrac {1}{3}},{\scriptstyle {\text{0}}},{\tfrac {1}{5}},{\scriptstyle {\text{0}}},{\tfrac {1}{7}},{\scriptstyle {\text{0}}},{\tfrac {1}{9}},{\scriptstyle {\text{0}}},\dots )} that decay only at the rate of 1 n {\displaystyle {\tfrac {1}{n}}} , while the continuous triangle wave has Fourier coefficients ( 1 1 2 , 0 , − 1 3 2 , 0 , 1 5 2 , 0 , − 1 7 2 , 0 , 1 9 2 , 0 , … ) {\displaystyle ({\tfrac {1}{1^{2}}},{\scriptstyle {\text{0}}},{\tfrac {-1}{3^{2}}},{\scriptstyle {\text{0}}},{\tfrac {1}{5^{2}}},{\scriptstyle {\text{0}}},{\tfrac {-1}{7^{2}}},{\scriptstyle {\text{0}}},{\tfrac {1}{9^{2}}},{\scriptstyle {\text{0}}},\dots )} that decay at a much faster rate of 1 n 2 {\displaystyle {\tfrac {1}{n^{2}}}} .
This only 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 Convergence of Fourier series § Absolute convergence.
Since the Gibbs phenomenon comes from undershooting, it may be eliminated by using kernels that are never negative, such as the Fejér kernel.
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 continuous wavelet transform, the wavelet Gibbs phenomenon never exceeds the Fourier Gibbs phenomenon. Also, using the discrete wavelet transform with Haar basis functions, the Gibbs phenomenon does not occur at all in the case of continuous data at jump discontinuities, and is minimal in the discrete case at large change points. In wavelet analysis, this is commonly referred to as the Longo phenomenon. In the polynomial interpolation setting, the Gibbs phenomenon can be mitigated using the S-Gibbs algorithm.
Let f : R → R {\textstyle f:{\mathbb {R} }\to {\mathbb {R} }} be a piecewise continuously differentiable function which is periodic with some period L > 0 {\textstyle L>0} . Suppose that at some point x 0 {\textstyle x_{0}} , the left limit f ( x 0 − ) {\textstyle f(x_{0}^{-})} and right limit f ( x 0 + ) {\textstyle f(x_{0}^{+})} of the function f {\textstyle f} differ by a non-zero jump of c {\textstyle c} : f ( x 0 + ) − f ( x 0 − ) = c ≠ 0. {\displaystyle f(x_{0}^{+})-f(x_{0}^{-})=c\neq 0.}
For each positive integer N {\textstyle N} ≥ 1, let S N f ( x ) {\textstyle S_{N}f(x)} be the N {\textstyle N} partial Fourier series ( S N {\textstyle S_{N}} can be treated as a mathematical operator on functions.) S N f ( x ) := ∑ − N ≤ n ≤ N f ^ ( n ) e i 2 π n x L = 1 2 a 0 + ∑ n = 1 N ( a n cos ⁡ ( 2 π n x L ) + b n sin ⁡ ( 2 π n x L ) ) , {\displaystyle S_{N}f(x):=\sum _{-N\leq n\leq N}{\widehat {f}}(n)e^{\frac {i2\pi nx}{L}}={\frac {1}{2}}a_{0}+\sum _{n=1}^{N}\left(a_{n}\cos \left({\frac {2\pi nx}{L}}\right)+b_{n}\sin \left({\frac {2\pi nx}{L}}\right)\right),}
where the Fourier coefficients f ^ ( n ) , a n , b n {\textstyle {\widehat {f}}(n),a_{n},b_{n}} for integers n {\textstyle n} are given by the usual formulae f ^ ( n ) := 1 L ∫ 0 L f ( x ) e − i 2 π n x L d x {\displaystyle {\widehat {f}}(n):={\frac {1}{L}}\int _{0}^{L}f(x)e^{-{\frac {i2\pi nx}{L}}}\,dx} a 0 := 1 L ∫ 0 L f ( x ) d x {\displaystyle a_{0}:={\frac {1}{L}}\int _{0}^{L}f(x)\ dx} a n := 2 L ∫ 0 L f ( x ) cos ⁡ ( 2 π n x L ) d x {\displaystyle a_{n}:={\frac {2}{L}}\int _{0}^{L}f(x)\cos \left({\frac {2\pi nx}{L}}\right)\,dx} b n := 2 L ∫ 0 L f ( x ) sin ⁡ ( 2 π n x L ) d x . {\displaystyle b_{n}:={\frac {2}{L}}\int _{0}^{L}f(x)\sin \left({\frac {2\pi nx}{L}}\right)\,dx.}
Then we have lim N → ∞ S N f ( x 0 + L 2 N ) = f ( x 0 + ) + c ⋅ ( 0.089489872236 … ) {\displaystyle \lim _{N\to \infty }S_{N}f\left(x_{0}+{\frac {L}{2N}}\right)=f(x_{0}^{+})+c\cdot (0.089489872236\dots )} and lim N → ∞ S N f ( x 0 − L 2 N ) = f ( x 0 − ) − c ⋅ ( 0.089489872236 … ) {\displaystyle \lim _{N\to \infty }S_{N}f\left(x_{0}-{\frac {L}{2N}}\right)=f(x_{0}^{-})-c\cdot (0.089489872236\dots )} but lim N → ∞ S N f ( x 0 ) = f ( x 0 − ) + f ( x 0 + ) 2 . {\displaystyle \lim _{N\to \infty }S_{N}f(x_{0})={\frac {f(x_{0}^{-})+f(x_{0}^{+})}{2}}.}
More generally, if x N {\textstyle x_{N}} is any sequence of real numbers which converges to x 0 {\textstyle x_{0}} as N → ∞ {\textstyle N\to \infty } , and if the jump of a {\textstyle a} is positive then lim sup N → ∞ S N f ( x N ) ≤ f ( x 0 + ) + c ⋅ ( 0.089489872236 … ) {\displaystyle \limsup _{N\to \infty }S_{N}f(x_{N})\leq f(x_{0}^{+})+c\cdot (0.089489872236\dots )} and lim inf N → ∞ S N f ( x N ) ≥ f ( x 0 − ) − c ⋅ ( 0.089489872236 … ) . {\displaystyle \liminf _{N\to \infty }S_{N}f(x_{N})\geq f(x_{0}^{-})-c\cdot (0.089489872236\dots ).}
If instead the jump of c {\textstyle c} is negative, one needs to interchange limit superior ( lim sup {\textstyle \limsup } ) with limit inferior ( lim inf {\textstyle \liminf } ), and also interchange the ≤ {\textstyle \leq } and ≥ {\textstyle \geq } signs, in the above two inequalities.
Stated again, let f : R → R {\textstyle f:{\mathbb {R} }\to {\mathbb {R} }} be a piecewise continuously differentiable function which is periodic with some period L > 0 {\textstyle L>0} , and this function has multiple jump discontinuity points denoted x i {\textstyle x_{i}} where i = 0 , 1 , 2 , {\textstyle i=0,1,2,} and so on. At each discontinuity, the amount of the vertical full jump is c i {\textstyle c_{i}} .
Then, f {\textstyle f} can be expressed as the sum of a continuous function f c {\textstyle f_{c}} and a multi-step function f s {\textstyle f_{s}} which is the sum of step functions such as
f = f c + f s , {\displaystyle f=f_{c}+f_{s},} f s = f s 1 + f s 2 + f s 3 + ⋯ , {\displaystyle f_{s}=f_{s_{1}}+f_{s_{2}}+f_{s_{3}}+\cdots ,} f s i ( x ) = { 0 if x ≤ x i , c i , if x > x i . {\displaystyle f_{s_{i}}(x)={\begin{cases}0&{\text{if }}x\leq x_{i},\\c_{i},&{\text{if }}x>x_{i}.\end{cases}}}
S N f ( x ) {\textstyle S_{N}f(x)} as the N {\textstyle N} partial Fourier series of f = f c + f s = f c + ( f s 1 + f s 2 + f s 3 + … ) {\textstyle f=f_{c}+f_{s}=f_{c}+\left(f_{s_{1}}+f_{s_{2}}+f_{s_{3}}+\ldots \right)} will converge well at all x {\textstyle x} points except points near discontinuities x i {\textstyle x_{i}} . Around each discontinuity point x i {\textstyle x_{i}} , f s i {\textstyle f_{s_{i}}} will only have the Gibbs phenomenon of its own (the maximum oscillatory convergence error of ~ 9% of the jump c i {\displaystyle c_{i}} , as shown in the square wave analysis) because other functions are continuous ( f c {\displaystyle f_{c}} ) or flat zero ( f s j {\displaystyle f_{s_{j}}} where j ≠ i {\displaystyle j\neq i} ) around that point. This proves how the Gibbs phenomenon occurs at every discontinuity.
From a signal processing point of view, the Gibbs phenomenon is the step response of a low-pass filter, and the oscillations are called ringing or ringing artifacts. Truncating the Fourier transform of a signal on the real line, or the Fourier series of a periodic signal (equivalently, a signal on the circle), corresponds to filtering out the higher frequencies with an ideal (brick-wall) low-pass filter. This can be represented as convolution of the original signal with the impulse response of the filter (also known as the kernel), which is the sinc function. Thus, the Gibbs phenomenon can be seen as the result of convolving a Heaviside step function (if periodicity is not required) or a square wave (if periodic) with a sinc function: the oscillations in the sinc function cause the ripples in the output.
In the case of convolving with a Heaviside step function, the resulting function is exactly the integral of the sinc function, the sine integral; for a square wave the description is not as simply stated. For the step function, the magnitude of the undershoot is thus exactly the integral of the left tail until the first negative zero: for the normalized sinc of unit sampling period, this is ∫ − ∞ − 1 sin ⁡ ( π x ) π x d x . {\textstyle \int _{-\infty }^{-1}{\frac {\sin(\pi x)}{\pi x}}\,dx.} The overshoot is accordingly of the same magnitude: the integral of the right tail or (equivalently) the difference between the integral from negative infinity to the first positive zero minus 1 (the non-overshooting value).
The overshoot and undershoot can be understood thus: kernels are generally normalized to have integral 1, so they result in a mapping of constant functions to constant functions – otherwise they have gain. The value of a convolution at a point is a linear combination of the input signal, with coefficients (weights) the values of the kernel.
If a kernel is non-negative, such as for a Gaussian kernel, then the value of the filtered signal will be a convex combination of the input values (the coefficients (the kernel) integrate to 1, and are non-negative), and will thus fall between the minimum and maximum of the input signal – it will not undershoot or overshoot. If, on the other hand, the kernel assumes negative values, such as the sinc function, then the value of the filtered signal will instead be an affine combination of the input values and may fall outside of the minimum and maximum of the input signal, resulting in undershoot and overshoot, as in the Gibbs phenomenon.
Taking a longer expansion – cutting at a higher frequency – corresponds in the frequency domain to widening the brick-wall, which in the time domain corresponds to narrowing the sinc function and increasing its height by the same factor, leaving the integrals between corresponding points unchanged. This is a general feature of the Fourier transform: widening in one domain corresponds to narrowing and increasing height in the other. This results in the oscillations in sinc being narrower and taller, and (in the filtered function after convolution) yields oscillations that are narrower (and thus with smaller area) but which do not have reduced magnitude: cutting off at any finite frequency results in a sinc function, however narrow, with the same tail integrals. This explains the persistence of the overshoot and undershoot.
Thus, the features of the Gibbs phenomenon are interpreted as follows:
We examine the N {\textstyle N} partial Fourier series S N f ( x ) {\textstyle S_{N}f(x)} of a square wave f ( x ) {\textstyle f(x)} with the periodicity L {\textstyle L} and a discontinuity of a vertical "full" jump c {\textstyle c} from y = y 0 {\textstyle y=y_{0}} at x = x 0 {\textstyle x=x_{0}} . Because the case of odd N {\textstyle N} is very similar, let us just deal with the case when N {\textstyle N} is even:
S N f ( x ) = ( y 0 + c 2 ) + 2 c π ( sin ⁡ ( ω ( x − x 0 ) ) + 1 3 sin ⁡ ( 3 ω ( x − x 0 ) ) + ⋯ + 1 N − 1 sin ⁡ ( ( N − 1 ) ω ( x − x 0 ) ) ) {\displaystyle S_{N}f(x)=\left(y_{0}+{\frac {c}{2}}\right)+{\frac {2c}{\pi }}\left(\sin(\omega (x-x_{0}))+{\frac {1}{3}}\sin(3\omega (x-x_{0}))+\cdots +{\frac {1}{N-1}}\sin((N-1)\omega (x-x_{0}))\right)}
with ω = 2 π L {\textstyle \omega ={\frac {2\pi }{L}}} . ( N = 2 N ′ {\textstyle N=2N'} where N ′ {\textstyle N'} is the number of non-zero sinusoidal Fourier series components so there are literatures using N ′ {\textstyle N'} instead of N {\textstyle N} .) Substituting x = x 0 {\textstyle x=x_{0}} (a point of discontinuity), we obtain S N f ( x 0 ) = ( y 0 + c 2 ) = f ( 0 − ) + f ( 0 + ) 2 = y 0 + ( y 0 + c ) 2 {\displaystyle S_{N}f(x_{0})=\left(y_{0}+{\frac {c}{2}}\right)={\frac {f(0^{-})+f(0^{+})}{2}}={\frac {y_{0}+(y_{0}+c)}{2}}} as claimed above. (The first term that only survives is the average of the Fourier series.)
Next, we find the first maximum of the oscillation around the discontinuity x = x 0 {\textstyle x=x_{0}} by checking the first and second derivatives of S N f ( x ) {\textstyle S_{N}f(x)} . The first condition for the maximum is that the first derivative equals to zero as
d d x S N f ( x ) = 2 c π ( cos ⁡ ( ω ( x − x 0 ) ) + cos ⁡ ( 3 ω ( x − x 0 ) ) + ⋯ + cos ⁡ ( ( N − 1 ) ω ( x − x 0 ) ) ) = c π sin ⁡ ( N ω ( x − x 0 ) ) sin ⁡ ( ω ( x − x 0 ) ) = 0 {\displaystyle {\frac {d}{dx}}S_{N}f(x)={\frac {2c}{\pi }}\left(\cos(\omega (x-x_{0}))+\cos(3\omega (x-x_{0}))+\cdots +\cos((N-1)\omega (x-x_{0}))\right)={\frac {c}{\pi }}{\frac {\sin(N\omega (x-x_{0}))}{\sin(\omega (x-x_{0}))}}=0}
where the 2nd equality is from one of Lagrange's trigonometric identities. Solving this condition gives x − x 0 = k π / ( N ω ) = k L / ( 2 N ) {\textstyle x-x_{0}=k\pi /(N\omega )=kL/(2N)} for integers k {\textstyle k} excluding multiples of N ω {\textstyle N\omega } to avoid the zero denominator, so k = 1 , 2 , … , N ω − 1 , N ω + 1 , … {\textstyle k=1,2,\ldots ,N\omega -1,N\omega +1,\ldots } and their negatives are allowed.
The second derivative of S N f ( x ) {\textstyle S_{N}f(x)} at x − x 0 = k L / ( 2 N ) {\textstyle x-x_{0}=kL/(2N)} is
d 2 d x 2 S N f ( x ) = c ω π ( N cos ⁡ ( N ω ( x − x 0 ) ) sin ⁡ ( ω ( x − x 0 ) ) − sin ⁡ ( N ω ( x − x 0 ) ) cos ⁡ ( ω ( x − x 0 ) ) sin 2 ⁡ ( ω ( x − x 0 ) ) ) , {\displaystyle {\frac {d^{2}}{dx^{2}}}S_{N}f(x)={\frac {c\omega }{\pi }}\left({\frac {N\cos(N\omega (x-x_{0}))\sin(\omega (x-x_{0}))-\sin(N\omega (x-x_{0}))\cos(\omega (x-x_{0}))}{\sin ^{2}(\omega (x-x_{0}))}}\right),} d 2 d x 2 S N f ( x ) | x 0 + k L / ( 2 N ) = { 2 c L N sin ⁡ ( k π / N ) , if k is even, 2 c L − N sin ⁡ ( k π / N ) , if k is odd. {\displaystyle \left.{\frac {d^{2}}{dx^{2}}}S_{N}f(x)\right\vert _{x_{0}+kL/(2N)}={\begin{cases}{\frac {2c}{L}}{\frac {N}{\sin(k\pi /N)}},&{\text{if }}k{\text{ is even,}}\\[4pt]{\frac {2c}{L}}{\frac {-N}{\sin(k\pi /N)}},&{\text{if }}k{\text{ is odd.}}\end{cases}}}
Thus, the first maximum occurs at x = x 0 + L / ( 2 N ) {\textstyle x=x_{0}+L/(2N)} ( k = 1 {\textstyle k=1} ) and S N f ( x ) {\textstyle S_{N}f(x)} at this x {\textstyle x} value is S N f ( x 0 + L 2 N ) = ( y 0 + c 2 ) + 2 c π ( sin ⁡ ( π N ) + 1 3 sin ⁡ ( 3 π N ) + ⋯ + 1 N − 1 sin ⁡ ( ( N − 1 ) π N ) ) {\displaystyle S_{N}f\left(x_{0}+{\frac {L}{2N}}\right)=\left(y_{0}+{\frac {c}{2}}\right)+{\frac {2c}{\pi }}\left(\sin \left({\frac {\pi }{N}}\right)+{\frac {1}{3}}\sin \left({\frac {3\pi }{N}}\right)+\cdots +{\frac {1}{N-1}}\sin \left({\frac {(N-1)\pi }{N}}\right)\right)}
If we introduce the normalized sinc function sinc ⁡ ( x ) = sin ⁡ ( π x ) π x {\textstyle \operatorname {sinc} (x)={\frac {\sin(\pi x)}{\pi x}}} for x ≠ 0 {\textstyle x\neq 0} , we can rewrite this as S N f ( x 0 + L 2 N ) = ( y 0 + c 2 ) + c [ 2 N sinc ⁡ ( 1 N ) + 2 N sinc ⁡ ( 3 N ) + ⋯ + 2 N sinc ⁡ ( ( N − 1 ) N ) ] . {\displaystyle S_{N}f\left(x_{0}+{\frac {L}{2N}}\right)=(y_{0}+{\frac {c}{2}})+c\left[{\frac {2}{N}}\operatorname {sinc} \left({\frac {1}{N}}\right)+{\frac {2}{N}}\operatorname {sinc} \left({\frac {3}{N}}\right)+\cdots +{\frac {2}{N}}\operatorname {sinc} \left({\frac {(N-1)}{N}}\right)\right].}
For a sufficiently large N {\textstyle N} , the expression in the square brackets is a Riemann sum approximation to the integral ∫ 0 1 sinc ⁡ ( x ) d x {\textstyle \int _{0}^{1}\operatorname {sinc} (x)\ dx} (more precisely, it is a midpoint rule approximation with spacing 2 N {\displaystyle {\tfrac {2}{N}}} ). Since the sinc function is continuous, this approximation converges to the integral as N → ∞ {\displaystyle N\to \infty } . Thus, we have
lim N → ∞ S N f ( x 0 + L 2 N ) = ( y 0 + c 2 ) + c ∫ 0 1 sinc ⁡ ( x ) d x = ( y 0 + c 2 ) + c π ∫ x = 0 1 sin ⁡ ( π x ) π x d ( π x ) = ( y 0 + c 2 ) + c π ∫ 0 π sin ⁡ ( t ) t d t = ( y 0 + c ) + c ⋅ ( 0.089489872236 … ) , {\displaystyle {\begin{aligned}\lim _{N\to \infty }S_{N}f\left(x_{0}+{\frac {L}{2N}}\right)&=(y_{0}+{\frac {c}{2}})+c\int _{0}^{1}\operatorname {sinc} (x)\,dx\\[8pt]&=(y_{0}+{\frac {c}{2}})+{\frac {c}{\pi }}\int _{x=0}^{1}{\frac {\sin(\pi x)}{\pi x}}\,d(\pi x)\\[8pt]&=(y_{0}+{\frac {c}{2}})+{\frac {c}{\pi }}\int _{0}^{\pi }{\frac {\sin(t)}{t}}\ dt\quad =\quad (y_{0}+c)+c\cdot (0.089489872236\dots ),\end{aligned}}}
which was claimed in the previous section. A similar computation shows
lim N → ∞ S N f ( x 0 − L 2 N ) = − c ∫ 0 1 sinc ⁡ ( x ) d x = y 0 − c ⋅ ( 0.089489872236 … ) . {\displaystyle \lim _{N\to \infty }S_{N}f\left(x_{0}-{\frac {L}{2N}}\right)=-c\int _{0}^{1}\operatorname {sinc} (x)\,dx=y_{0}-c\cdot (0.089489872236\dots ).}
The Gibbs phenomenon is undesirable because it causes artifacts, namely clipping from the overshoot and undershoot, and ringing artifacts from the oscillations. In the case of low-pass filtering, these can be reduced or eliminated by using different low-pass filters.
In MRI, the Gibbs phenomenon causes artifacts in the presence of adjacent regions of markedly differing signal intensity. This is most commonly encountered in spinal MRIs where the Gibbs phenomenon may simulate the appearance of syringomyelia.
The Gibbs phenomenon manifests as a cross pattern artifact in the discrete Fourier transform of an image, where most images (e.g. micrographs or photographs) have a sharp discontinuity between boundaries at the top / bottom and left / right of an image. When periodic boundary conditions are imposed in the Fourier transform, this jump discontinuity is represented by continuum of frequencies along the axes in reciprocal space (i.e. a cross pattern of intensity in the Fourier transform).
And although this article mainly focused on the difficulty with trying to construct discontinuities without artifacts in the time domain with only a partial Fourier series, it is also important to consider that because the inverse Fourier transform is extremely similar to the Fourier transform, there equivalently is difficulty with trying to construct discontinuities in the frequency domain using only a partial Fourier series. Thus for instance because idealized brick-wall and rectangular filters have discontinuities in the frequency domain, their exact representation in the time domain necessarily requires an infinitely-long sinc filter impulse response, since a finite impulse response will result in Gibbs rippling in the frequency response near cut-off frequencies, though this rippling can be reduced by windowing finite impulse response filters (at the expense of wider transition bands).