Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Gibbs phenomenon
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Oscillatory error in Fourier series}} In [[mathematics]], the '''Gibbs phenomenon''' is the [[Oscillation|oscillatory]] behavior of the [[Fourier series]] of a [[piecewise]] [[Differentiable function#continuously differentiable|continuously differentiable]] [[periodic function]] around a [[jump discontinuity]]. The <math display="inline">N</math><sup>th</sup> partial Fourier series of the function (formed by [[Summation|summing]] the <math display="inline">N</math> lowest constituent [[sinusoid]]s of the Fourier series of the function) produces large peaks around the jump which [[Overshoot (signal)|overshoot and undershoot]] the function values. As more sinusoids are used, this [[approximation error]] approaches a [[Limit (mathematics)|limit]] of about 9% of the jump, though the [[Infinity|infinite]] Fourier [[Series (mathematics)|series sum]] does eventually [[Pointwise convergence#Almost everywhere convergence|converge almost everywhere]].<ref name=Carslaw>{{cite book | author=H. S. Carslaw | title=Introduction to the theory of Fourier's series and integrals | chapter=Chapter IX | year= 1930 | edition=Third | publisher=Dover Publications Inc. | location=New York | chapter-url=https://books.google.com/books?id=JNVAAAAAIAAJ&q=intitle:Introduction+intitle:to+intitle:the+intitle:theory+intitle:of+intitle:Fourier%27s+intitle:series+intitle:and+intitle:integrals+inauthor:carslaw}}</ref> The Gibbs phenomenon was observed by experimental physicists and was believed to be due to imperfections in the measuring apparatus,<ref>{{harvnb|Vretblad|2000}} Section 4.7.</ref> 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]]. ==Description== [[Image:Gibbs phenomenon 10.svg|thumb|right|Functional approximation of square wave using 5 harmonics]] [[Image:Gibbs phenomenon 50.svg|thumb|right|Functional approximation of square wave using 25 harmonics]] [[Image:Gibbs phenomenon 250.svg|thumb|right|Functional approximation of square wave using 125 harmonics]] The Gibbs phenomenon is a behavior of the [[Fourier series]] of a function with a [[jump discontinuity]] and is described as the following:<blockquote>As more Fourier series constituents or components are taken, the Fourier series shows the first overshoot in the oscillatory behavior around the jump point approaching ~ 9% of the (full) jump and this oscillation does not disappear but gets closer to the point so that the integral of the oscillation approaches zero.</blockquote>At the jump point, the Fourier series gives the average of the function's both side limits toward the point. === Square wave example === The three pictures on the right demonstrate the Gibbs phenomenon for a [[Square wave (waveform)|square wave]] (with peak-to-peak amplitude of <math display="inline">c</math> from <math display="inline">-c/2</math> to <math display="inline">c/2</math> and the periodicity <math display="inline">L</math>) whose <math display="inline">N</math><sup>th</sup> partial Fourier series is <math display="block"> \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 )</math> where <math display="inline">\omega = 2\pi/L</math>. More precisely, this square wave is the function <math display="inline">f(x)</math> which equals <math>\tfrac{c}{2}</math> between <math display="inline">2n(L/2)</math> and <math display="inline">(2n+1)(L/2)</math> and <math display="inline">-\tfrac{c}{2}</math> between <math display="inline">(2n+1)(L/2)</math> and <math display="inline">(2n+2)(L/2)</math> for every [[integer]] <math display="inline">n</math>; thus, this square wave has a jump discontinuity of peak-to-peak height <math display="inline">c</math> at every integer multiple of <math display="inline">L/2</math>. As more sinusoidal terms are added (i.e., increasing <math display="inline">N</math>), 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.<ref>{{Cite web |date=2020-05-24 |title=6.7: Gibbs Phenomena |url=https://eng.libretexts.org/Bookshelves/Electrical_Engineering/Signal_Processing_and_Modeling/Signals_and_Systems_(Baraniuk_et_al.)/06%3A_Continuous_Time_Fourier_Series_(CTFS)/6.07%3A_Gibbs_Phenomena |access-date=2022-03-03 |website=Engineering LibreTexts |language=en}}</ref> [[Gibbs phenomenon#Square wave analysis|The square wave analysis]] reveals that the error exceeds the height (from zero) <math>\tfrac{c}{2}</math> of the square wave by <math display="block">\frac{c}{\pi} \int_0^\pi \frac{\sin(t)}{t}\ dt - \frac{c}{2} = c \cdot (0.089489872236\dots).</math>({{OEIS2C|A243268}}) or about 9% of the full jump <math display="inline">c</math>. More generally, at any discontinuity of a piecewise continuously differentiable function with a jump of <math display="inline">c</math>, the <math display="inline">N</math><sup>th</sup> partial Fourier series of the function will (for a very large <math display="inline">N</math> value) overshoot this jump by an error approaching <math display="inline">c \cdot (0.089489872236\dots)</math> 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 conditions|Dirichlet's theorem]].<ref name="Pinksky" /> The quantity <math display="block">\int_0^\pi \frac{\sin t}{t}\ dt = (1.851937051982\dots) = \frac{\pi}{2} + \pi \cdot (0.089489872236\dots)</math>({{OEIS2C|A036792}}) is sometimes known as the ''[[Henry Wilbraham|Wilbraham]]–Gibbs constant''.<ref>Steven R. Finch, ''Mathematical Constants'', Cambridge University Press, 2003, Section 4.1 Gibbs-Wilbraham constant, p. 249.</ref> === History === The Gibbs phenomenon was first noticed and analyzed by [[Henry Wilbraham]] in an 1848 paper.<ref>Wilbraham, Henry (1848) [https://books.google.com/books?id=JrQ4AAAAMAAJ&pg=PA198 "On a certain periodic function"], ''The Cambridge and Dublin Mathematical Journal'', '''3''' : 198–201.</ref> The paper attracted little attention until 1914 when it was mentioned in [[Heinrich Burkhardt]]'s review of mathematical analysis in [[Klein's encyclopedia]].<ref>{{cite book|title=Encyklopädie der Mathematischen Wissenschaften mit Einschluss ihrer Anwendungen|volume=II T. 1 H 1|date=1914|publisher=Vieweg+Teubner Verlag|location=Wiesbaden|page=1049|url=http://gdz.sub.uni-goettingen.de/pdfcache/PPN360506208/PPN360506208___LOG_0158.pdf|access-date=14 September 2016}}</ref> In 1898, [[Albert A. Michelson]] developed a device that could compute and re-synthesize the Fourier series.<ref>{{cite book|last1=Hammack|first1=Bill| last2=Kranz|first2=Steve| last3=Carpenter|first3=Bruce| title=Albert Michelson's Harmonic Analyzer: A Visual Tour of a Nineteenth Century Machine that Performs Fourier Analysis|publisher=Articulate Noise Books|isbn=9780983966173|url=http://www.engineerguy.com/fourier/|access-date=14 September 2016|language=en|date=2014-10-29}}</ref> 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 {{harv|Michelson|Stratton|1898}} about his machine or his later letters to ''[[Nature (journal)|Nature]]''.<ref name="Hewitt 1979 129–160">{{cite journal |last=Hewitt |first=Edwin |author2=Hewitt, Robert E. |year=1979 |title=The Gibbs-Wilbraham phenomenon: An episode in Fourier analysis |journal=Archive for History of Exact Sciences |volume=21 |issue=2 |pages=129–160 |doi=10.1007/BF00330404 |s2cid=119355426}} Available on-line at: [http://ocw.nctu.edu.tw/course/fourier/supplement/hewitt-hewitt1979.pdf National Chiao Tung University: Open Course Ware: Hewitt & Hewitt, 1979.] {{Webarchive|url=https://web.archive.org/web/20160304104811/http://ocw.nctu.edu.tw/course/fourier/supplement/hewitt-hewitt1979.pdf|date=2016-03-04}}</ref> Inspired by correspondence in ''Nature'' between Michelson and [[Augustus Edward Hough Love|A. E. H. Love]] about the convergence of the Fourier series of the square wave function, [[Willard Gibbs|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"<ref>Bôcher, Maxime (April 1906) [https://www.jstor.org/stable/1967238?seq=1 "Introduction to the theory of Fourier's series"], ''Annals of Mathethematics'', second series, '''7''' (3) : 81–152. The Gibbs phenomenon is discussed on pages 123–132; Gibbs's role is mentioned on page 129.</ref> and bringing it into widespread use.<ref name="Hewitt 1979 129–160"/> 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."<ref>{{cite journal|last1=Carslaw|first1=H. S.|title=A historical note on Gibbs' phenomenon in Fourier's series and integrals|journal=Bulletin of the American Mathematical Society|date=1 October 1925| volume=31 | issue=8 | pages=420–424|url=https://projecteuclid.org/euclid.bams/1183486614|access-date=14 September 2016 | language=EN | issn=0002-9904 | doi=10.1090/s0002-9904-1925-04081-1|doi-access=free}}</ref> === Explanation === Informally, the Gibbs phenomenon reflects the difficulty inherent in approximating a [[discontinuous function]] by a ''finite'' series of [[continuous function|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 [[Smoothness#Differentiability classes|continuously differentiable (class ''C''<sup>1</sup>) 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 conditions|Dirichlet's theorem]].<ref name=Pinksky>{{cite book | author=M. Pinsky | title=Introduction to Fourier Analysis and Wavelets | url=https://archive.org/details/introductiontofo00pins_232 | url-access=limited | page=[https://archive.org/details/introductiontofo00pins_232/page/n37 27] | year= 2002 | publisher=Brooks/Cole | location=United states of America }}</ref> 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 <math>(\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)</math> that decay only at the rate of <math>\tfrac{1}{n}</math>, while the continuous [[Triangle wave#Harmonics|triangle wave]] has Fourier coefficients <math>(\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)</math> that decay at a much faster rate of <math>\tfrac{1}{n^2}</math>. This only provides a partial explanation of the Gibbs phenomenon, since Fourier series with [[Absolute convergence|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 {{format link|Convergence of Fourier series#Absolute convergence}}. === Solutions === Since the Gibbs phenomenon comes from undershooting, it may be eliminated by using kernels that are never negative, such as the [[Fejér kernel]].<ref>{{Cite journal |last1=Gottlieb |first1=David |last2=Shu |first2=Chi-Wang |date=January 1997 |title=On the Gibbs Phenomenon and Its Resolution |url=http://epubs.siam.org/doi/10.1137/S0036144596301390 |journal=SIAM Review |language=en |volume=39 |issue=4 |pages=644–668 |doi=10.1137/S0036144596301390 |bibcode=1997SIAMR..39..644G |issn=0036-1445}}</ref><ref>{{Cite journal |last1=Gottlieb |first1=Sigal |last2=Jung |first2=Jae-Hun |last3=Kim |first3=Saeja |date=March 2011 |title=A Review of David Gottlieb's Work on the Resolution of the Gibbs Phenomenon |url=https://www.cambridge.org/core/journals/communications-in-computational-physics/article/abs/review-of-david-gottliebs-work-on-the-resolution-of-the-gibbs-phenomenon/C77B063AC18D2AF7CF7A6A77028C8528 |journal=Communications in Computational Physics |language=en |volume=9 |issue=3 |pages=497–519 |doi=10.4208/cicp.301109.170510s |bibcode=2011CCoPh...9..497G |issn=1815-2406}}</ref> 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.<ref>Rasmussen, Henrik O. "The Wavelet Gibbs Phenomenon". In ''Wavelets, Fractals and Fourier Transforms'', Eds [[Marie Farge|M. Farge]] et al., Clarendon Press, Oxford, 1993.</ref> 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,<ref>{{cite journal |url=http://www.uwlax.edu/faculty/kelly/Publications/GibbsJan.pdf |last=Kelly |first=Susan E. |title=Gibbs Phenomenon for Wavelets |journal=Applied and Computational Harmonic Analysis |issue=3 |year=1995 |access-date=2012-03-31 |url-status=dead |archive-url=https://web.archive.org/web/20130909200315/http://www.uwlax.edu/faculty/kelly/Publications/GibbsJan.pdf |archive-date=2013-09-09 }}</ref> 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.<ref name=FakeNodes>{{cite journal | first1 = Stefano | last1 = De Marchi | author1-link = Stefano De Marchi | first2 = Francesco | last2 = Marchetti | first3 = Emma | last3 = Perracchione | first4 = Davide | last4 = Poggiali | title = Polynomial interpolation via mapped bases without resampling | doi = 10.1016/j.cam.2019.112347 | journal = J. Comput. Appl. Math. | volume = 364 | year = 2020 | page = 112347 | s2cid = 199688130 | issn = 0377-0427 | doi-access = free }}</ref> == Formal mathematical description of the Gibbs phenomenon == Let <math display="inline">f: {\mathbb R} \to {\mathbb R}</math> be a [[piecewise]] [[Differentiable function#continuously differentiable|continuously differentiable]] function which is periodic with some period <math display="inline">L > 0</math>. Suppose that at some point <math display="inline">x_0</math>, the left limit <math display="inline">f(x_0^-)</math> and right limit <math display="inline">f(x_0^+)</math> of the function <math display="inline">f</math> differ by a non-zero jump of <math display="inline">c</math>: <math display="block"> f(x_0^+) - f(x_0^-) = c \neq 0.</math> For each positive integer <math display="inline">N</math> ≥ 1, let <math display="inline"> S_N f(x)</math> be the <math display="inline">N</math><sup>th</sup> partial [[Fourier series]] (<math display="inline">S_N</math> can be treated as a mathematical operator on functions.) <math display="block"> S_N f(x) := \sum_{-N \leq n \leq N} \widehat f(n) e^{\frac{i2\pi n x}{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),</math> where the Fourier coefficients <math display="inline">\widehat f(n), a_n, b_n</math> for integers <math display="inline">n</math> are given by the usual formulae <math display="block"> \widehat f(n) := \frac{1}{L} \int_0^L f(x) e^{-\frac{i2\pi nx}{L}}\, dx</math> <math display="block"> a_0 := \frac{1}{L} \int_0^L f(x)\ dx</math> <math display="block"> a_n := \frac{2}{L} \int_0^L f(x) \cos\left(\frac{2\pi nx}{L}\right)\, dx</math> <math display="block"> b_n := \frac{2}{L} \int_0^L f(x) \sin\left(\frac{2\pi nx}{L}\right)\, dx.</math> Then we have <math display="block"> \lim_{N \to \infty} S_N f\left(x_0 + \frac{L}{2N}\right) = f(x_0^+) + c\cdot (0.089489872236\dots)</math> and <math display="block"> \lim_{N \to \infty} S_N f\left(x_0 - \frac{L}{2N}\right) = f(x_0^-) - c\cdot (0.089489872236\dots)</math> but <math display="block"> \lim_{N \to \infty} S_N f(x_0) = \frac{f(x_0^-) + f(x_0^+)}{2}.</math> More generally, if <math display="inline">x_N</math> is any sequence of real numbers which converges to <math display="inline">x_0</math> as <math display="inline">N \to \infty</math>, and if the jump of <math display="inline">a</math> is positive then <math display="block"> \limsup_{N \to \infty} S_N f(x_N) \leq f(x_0^+) + c\cdot (0.089489872236\dots)</math> and <math display="block"> \liminf_{N \to \infty} S_N f(x_N) \geq f(x_0^-) - c\cdot (0.089489872236\dots).</math> If instead the jump of <math display="inline">c</math> is negative, one needs to interchange [[limit superior]] (<math display="inline"> \limsup</math>) with [[limit inferior]] (<math display="inline"> \liminf</math>), and also interchange the <math display="inline">\leq</math> and <math display="inline">\ge</math> signs, in the above two inequalities. === Proof of the Gibbs phenomenon in a general case === Stated again, let <math display="inline">f: {\mathbb R} \to {\mathbb R}</math> be a piecewise continuously differentiable function which is periodic with some period <math display="inline">L > 0</math>, and this function has multiple jump discontinuity points denoted <math display="inline">x_i</math> where <math display="inline">i = 0, 1, 2, </math> and so on. At each discontinuity, the amount of the vertical full jump is <math display="inline">c_i</math>. Then, <math display="inline">f</math> can be expressed as the sum of a continuous function <math display="inline">f_c</math> and a multi-step function <math display="inline">f_s </math> which is the sum of step functions such as<ref>{{Cite journal |last1=Fay |first1=Temple H. |last2=Kloppers |first2=P. Hendrik |year=2001 |title=The Gibbs' phenomenon |url=https://www.tandfonline.com/doi/abs/10.1080/00207390117151 |journal=International Journal of Mathematical Education in Science and Technology |volume=32 |issue=1 |pages=73–89 |doi=10.1080/00207390117151}}</ref> <math display="block">f = f_c + f_s,</math><math display="block">f_s = f_{s_1} + f_{s_2} + f_{s_3} + \cdots,</math><math display="block">f_{s_i}(x) = \begin{cases} 0 & \text{if } x \leq x_i, \\ c_i, & \text{if } x > x_i. \end{cases} </math> <math display="inline"> S_N f(x)</math> as the <math display="inline">N </math><sup>th</sup> partial Fourier series of <math display="inline">f = f_c + f_s = f_c + \left ( f_{s_1} + f_{s_2} + f_{s_3} + \ldots \right ) </math> will converge well at all <math display="inline">x </math> points except points near discontinuities <math display="inline">x_i</math>. Around each discontinuity point <math display="inline">x_i</math>, <math display="inline">f_{s_i} </math> will only have the Gibbs phenomenon of its own (the maximum oscillatory convergence error of ~ 9% of the jump <math>c_i </math>, as shown in the [[Gibbs phenomenon#Square wave analysis|square wave analysis]]) because other functions are continuous (<math>f_c</math>) or flat zero (<math>f_{s_j}</math> where <math>j \neq i</math>) around that point. This proves how the Gibbs phenomenon occurs at every discontinuity. == Signal processing explanation == {{further|Ringing artifacts}} [[File:Sinc function (both).svg|thumb|The [[sinc function]], the [[impulse response]] of an ideal [[low-pass filter]]. Scaling narrows the function, and correspondingly increases magnitude (which is not shown here), but does not reduce the magnitude of the undershoot, which is the integral of the tail.]] 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 (signal)|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 filter|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 [[Convolution kernel|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 (waveform)|square wave]] (if periodic) with a sinc function: the oscillations in the sinc function cause the ripples in the output. [[File:Sine integral.svg|thumb|The [[sine integral]], exhibiting the Gibbs phenomenon for a step function on the real line]] 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 <math display="inline">\int_{-\infty}^{-1} \frac{\sin(\pi x)}{\pi x}\,dx.</math> 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 (electronics)|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. <gallery style="align: center" widths="285px" heights="285px"> Image:Gibbs phenomenon 10.svg|Oscillations can be interpreted as convolution with a sinc. Image:Gibbs phenomenon 50.svg|Higher cutoff makes the sinc narrower but taller, with the same magnitude tail integrals, yielding higher frequency oscillations, but whose magnitude does not vanish. </gallery> Thus, the features of the Gibbs phenomenon are interpreted as follows: * the undershoot is due to the impulse response having a negative tail integral, which is possible because the function takes negative values; * the overshoot offsets this, by symmetry (the overall integral does not change under filtering); * the persistence of the oscillations is because increasing the cutoff narrows the impulse response but does not reduce its integral – the oscillations thus move towards the discontinuity, but do not decrease in magnitude. == Square wave analysis == [[Image:squareWave.gif|thumb|450px|right|Animation of the additive synthesis of a square wave (with the periodicity as 1 and the peak-to-peak amplitude as 2 from -1 to 1) with an increasing number of harmonics. The Gibbs phenomenon as oscillations around jump discontinuities is visible especially when the number of harmonics is large.]] We examine the <math display="inline">N</math><sup>th</sup> partial Fourier series <math display="inline"> S_N f(x)</math> of a [[Square wave (waveform)|square wave]] <math display="inline">f(x)</math> with the periodicity <math display="inline">L</math> and a discontinuity of a vertical "full" jump <math display="inline">c</math> from <math display="inline">y = y_0</math> at <math display="inline">x = x_0</math>. Because the case of odd <math display="inline">N</math> is very similar, let us just deal with the case when <math display="inline">N</math> is even: <math display="block">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 )</math> with <math display="inline">\omega = \frac{2\pi}{L}</math>. (<math display="inline">N = 2N'</math> where <math display="inline">N'</math> is the number of non-zero sinusoidal Fourier series components so there are literatures using <math display="inline">N'</math> instead of <math display="inline">N</math>.) Substituting <math display="inline">x = x_0</math> (a point of discontinuity), we obtain <math display="block">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}</math> 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 <math display="inline">x = x_0</math> by checking the first and second derivatives of <math display="inline"> S_N f(x)</math>. The first condition for the maximum is that the first derivative equals to zero as <math display="block">\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 </math> where the 2nd equality is from one of [[List of trigonometric identities#Lagrange's trigonometric identities|Lagrange's trigonometric identities]]. Solving this condition gives <math display="inline">x - x_0 = k\pi / (N\omega) = kL / (2N) </math> for integers <math display="inline">k </math> excluding multiples of <math display="inline">N\omega </math> to avoid the zero denominator, so <math display="inline">k = 1, 2, \ldots, N\omega - 1, N\omega + 1, \ldots </math> and their negatives are allowed. The second derivative of <math display="inline"> S_N f(x)</math> at <math display="inline">x - x_0 = kL / (2N) </math> is <math display="block">\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 ), </math><math display="block">\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} </math> Thus, the first maximum occurs at <math display="inline">x = x_0 + L / (2N) </math> (<math display="inline">k = 1 </math>) and <math display="inline"> S_N f(x)</math> at this <math display="inline">x </math> value is <math display="block">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 )</math> If we introduce the normalized [[sinc function]] <math display="inline">\operatorname{sinc}(x) = \frac{\sin(\pi x)}{\pi x}</math> for <math display="inline">x \neq 0</math>, we can rewrite this as <math display="block">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].</math> For a sufficiently large <math display="inline">N</math>, the expression in the square brackets is a [[Riemann sum]] approximation to the integral <math display="inline">\int_0^1 \operatorname{sinc}(x)\ dx</math> (more precisely, it is a [[midpoint rule]] approximation with spacing <math>\tfrac{2}{N}</math>). Since the sinc function is continuous, this approximation converges to the integral as <math>N \to \infty</math>. Thus, we have <math display="block"> \begin{align} \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{align} </math> which was claimed in the previous section. A similar computation shows <math display="block">\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).</math> ==Consequences== The Gibbs phenomenon is undesirable because it causes artifacts, namely [[Clipping (audio)|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,<ref>{{cite journal |author=R. Hovden, Y. Jiang, H.L. Xin, L.F. Kourkoutis|title=Periodic Artifact Reduction in Fourier Transforms of Full Field Atomic Resolution Images|journal=Microscopy and Microanalysis|year=2015|volume=21|issue=2|pages=436–441 | doi=10.1017/S1431927614014639|url=https://www.cambridge.org/core/journals/microscopy-and-microanalysis/article/div-classtitleperiodic-artifact-reduction-in-fourier-transforms-of-full-field-atomic-resolution-imagesdiv/80D0E226F0B4B16627AA0B6B9BD24F24 | pmid=25597865|s2cid=22435248|arxiv=2210.09024|bibcode=2015MiMic..21..436H }}</ref> 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 [[Fourier inversion theorem#Properties of inverse transform|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 filter|brick-wall]] and [[Rectangular function|rectangular]] filters have discontinuities in the [[frequency domain]], their exact representation in the [[time domain]] necessarily requires an [[Infinite impulse response|infinitely-long]] [[Sinc filter#Frequency-domain sinc|sinc filter impulse response]], since a [[finite impulse response]] will result in Gibbs rippling in the [[frequency response]] near [[Cutoff frequency|cut-off frequencies]], though this rippling can be reduced by [[Window function|windowing]] finite impulse response filters (at the expense of wider transition bands).<ref>{{Cite web |title=Gibbs phenomenon {{!}} RecordingBlogs |url=https://www.recordingblogs.com/wiki/gibbs-phenomenon |access-date=2022-03-05 |website=www.recordingblogs.com}}</ref> ==See also== * [[Mach bands]] * [[Pinsky phenomenon]] * [[Runge's phenomenon]] (a similar phenomenon in polynomial approximations) * [[Sigma approximation|σ-approximation]] which adjusts a Fourier summation to eliminate the Gibbs phenomenon which would otherwise occur at discontinuities * [[Sine integral]] ==Notes== {{reflist}} ==References== *{{Citation | last1=Gibbs | first1=J. Willard | author1-link=J. Willard Gibbs | title=Fourier's Series | doi=10.1038/059200b0 | year=1898 | journal=[[Nature (journal)|Nature]] | issn=0028-0836 | volume=59 | issue=1522 | pages=200| s2cid=4004787 | url=https://zenodo.org/record/1429384 | doi-access=free | bibcode=1898Natur..59..200G }} *{{Citation | last1=Gibbs | first1=J. Willard | author1-link=J. Willard Gibbs | title=Fourier's Series | doi=10.1038/059606a0 | year=1899 | journal=[[Nature (journal)|Nature]] | issn=0028-0836 | volume=59 | issue=1539 | pages=606| s2cid=13420929 | doi-access=free | bibcode=1899Natur..59..606G }} *{{Citation | last1=Michelson | first1=A. A. | last2=Stratton | first2=S. W. | title=A new harmonic analyser | year=1898 | journal= Philosophical Magazine | volume=5 | issue=45 | pages=85–91}} * {{cite book |last=Zygmund |first=Antoni |author-link=Antoni Zygmund |year=1959 |title=Trigonometric Series |title-link=Trigonometric Series |edition=2nd |publisher=Cambridge University Press }} [https://archive.org/details/trigonometricser0001zygm/ Volume 1], [https://archive.org/details/trigonometricser0002zygm/ Volume 2]. *{{Citation | last1=Wilbraham | first1=Henry | title=On a certain periodic function | url=https://books.google.com/books?id=JrQ4AAAAMAAJ&pg=PA198 | year=1848 | journal=[[The Cambridge and Dublin Mathematical Journal]] | volume=3 | pages=198–201}} * [[Paul J. Nahin]], ''Dr. Euler's Fabulous Formula,'' Princeton University Press, 2006. Ch. 4, Sect. 4. * {{citation|last=Vretblad|first=Anders|title=Fourier Analysis and its Applications|year=2000|isbn=978-0-387-00836-3|publisher=[[Springer Publishing]]|series=Graduate Texts in Mathematics|volume=223|pages=93|location=New York}} ==External links== *{{Commons category-inline}} * {{springer|title=Gibbs phenomenon|id=p/g044410}} * Weisstein, Eric W., "''[http://mathworld.wolfram.com/GibbsPhenomenon.html Gibbs Phenomenon]''". From MathWorld—A Wolfram Web Resource. * Prandoni, Paolo, "''[http://www.sp4comm.org/gibbs/gibbs.html Gibbs Phenomenon]''". * Radaelli-Sanchez, Ricardo, and Richard Baraniuk, "''[https://web.archive.org/web/20040506042335/http://cnx.rice.edu/content/m10092/latest/ Gibbs Phenomenon]''". The Connexions Project. (Creative Commons Attribution License) *[https://archive.org/details/introductiontot00unkngoog Horatio S Carslaw : Introduction to the theory of Fourier's series and integrals.pdf (introductiontot00unkngoog.pdf )] at [[archive.org]] * A [[Python (programming language)|Python]] implementation of the S-Gibbs algorithm mitigating the Gibbs Phenomenon https://github.com/pog87/FakeNodes. {{DEFAULTSORT:Gibbs Phenomenon}} [[Category:Real analysis]] [[Category:Fourier series]] [[Category:Numerical artifacts]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Commons category-inline
(
edit
)
Template:Format link
(
edit
)
Template:Further
(
edit
)
Template:Harv
(
edit
)
Template:Harvnb
(
edit
)
Template:OEIS2C
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Springer
(
edit
)
Template:Webarchive
(
edit
)