<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m10092">
  
  <name>Gibbs's Phenomena</name>
  
  <metadata>
  <md:version>2.9</md:version>
  <md:created>2001/06/13</md:created>
  <md:revised>2006/07/19 16:37:42.602 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="rars">
      <md:firstname>Ricardo</md:firstname>
      <md:othername>Anthony</md:othername>
      <md:surname>Radaelli-Sanchez</md:surname>
      <md:email>ricky@alumni.rice.edu</md:email>
    </md:author>
      <md:author id="richb">
      <md:firstname>Richard</md:firstname>
      <md:othername>G.</md:othername>
      <md:surname>Baraniuk</md:surname>
      <md:email>richb@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="mariyah">
      <md:firstname>Mariyah</md:firstname>
      
      <md:surname>Poonawala</md:surname>
      <md:email>mariyah@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="prash">
      <md:firstname>Prashant</md:firstname>
      
      <md:surname>Singh</md:surname>
      <md:email>prash@ece.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="rars">
      <md:firstname>Ricardo</md:firstname>
      <md:othername>Anthony</md:othername>
      <md:surname>Radaelli-Sanchez</md:surname>
      <md:email>ricky@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="jrom">
      <md:firstname>Justin</md:firstname>
      
      <md:surname>Romberg</md:surname>
      <md:email>jrom@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mselik">
      <md:firstname>Melissa</md:firstname>
      
      <md:surname>Selik</md:surname>
      <md:email>mselik@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mhutch">
      <md:firstname>Matthew</md:firstname>
      
      <md:surname>Hutchinson</md:surname>
      <md:email>mhutch@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>almost everywhere</md:keyword>
    <md:keyword>fourier series</md:keyword>
    <md:keyword>gibbs phenomenon</md:keyword>
    <md:keyword>nonuniform convergence</md:keyword>
  </md:keywordlist>

  <md:abstract>The Fourier Series is the representation of continuous-time,
periodic signals in terms of complex exponentials. The Dirichlet
conditions suggest that discontinuous signals may have a Fourier
Series representation so long as there are a finite number of
discontinuities. This seems counter-intuitive, however, as
complex exponentials are continuous functions. It does not seem
possible to exactly reconstruct a discontinuous function from a
set of continuous ones. In fact, it is not. However, it can be
if we relax the condition of exactly and replace it with the idea
of almost everywhere. This is to say that the reconstruction is
exactly the same as the original signal except at a finite number
of points. These points, not necessarily suprisingly, occur at
the points of discontinuities.</md:abstract>
</metadata>
  

  <content>
    <section id="intro">
      <name>Introduction</name>
      <para id="p_intro">
	The <cnxn document="m10496" strength="8">Fourier Series</cnxn>
	is the representation of continuous-time, periodic signals in
	terms of complex exponentials.  The <cnxn document="m10089" strength="7">Dirichlet conditions</cnxn> suggest that
	discontinuous signals may have a Fourier Series representation
	so long as there are a finite number of discontinuities.  This
	seems counter-intuitive, however, as <cnxn document="m10060" strength="8">complex exponentials</cnxn> are continuous
	functions.  It does not seem possible to exactly reconstruct a
	discontinuous function from a set of continuous ones.  In
	fact, it is not.  However, it can be if we relax the condition
	of 'exactly' and replace it with the idea of 'almost
	everywhere'.  This is to say that the reconstruction is
	exactly the same as the original signal except at a finite
	number of points.  These points, not necessarily surprisingly,
	occur at the points of discontinuities.
      </para>
      
      <section id="int_sub1">
	<name>History</name>
	<para id="p1_hist">
	  In the late 1800s, many machines were built to calculate
	  Fourier coefficients and re-synthesize:

	  <equation id="eq1">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:diff/>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>f</m:mi>
			<m:mi>N</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:ci>t</m:ci>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>n</m:ci>
		  </m:bvar>
		  <m:uplimit>
		    <m:ci>N</m:ci>
		  </m:uplimit>
		  <m:lowlimit>
		    <m:apply>
		      <m:minus/>
		      <m:ci>N</m:ci>
		    </m:apply>
		  </m:lowlimit>
		  <m:apply>
		    <m:times/>
		    <m:msub>
		      <m:mi>c</m:mi>
		      <m:mi>n</m:mi>
		    </m:msub>
		    <m:apply>
		      <m:exp/>
		      <m:apply>
			<m:times/>
			<m:imaginaryi/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>ω</m:mi>
			      <m:mn>0</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
			<m:ci>t</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  Albert Michelson (an extraordinary experimental physicist)
	  built a machine in 1898 that could compute 
	  <m:math display="inline">
	    <m:msub>
	      <m:mi>c</m:mi>
	      <m:mi>n</m:mi>
	    </m:msub>
	  </m:math>up to 
	  <m:math display="inline">
	    <m:apply>
	      <m:eq/>
	      <m:ci>n</m:ci>
	      <m:apply>
		<m:ci><m:mo>±</m:mo></m:ci>
		<m:cn>79</m:cn>
	      </m:apply>
	    </m:apply>
	  </m:math>, and he re-synthesized

	  <equation id="eq2">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:diff/>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>f</m:mi>
			<m:mn>79</m:mn>
		      </m:msub>
		    </m:ci>
		    <m:ci>t</m:ci>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>n</m:ci>
		  </m:bvar>
		  <m:uplimit>
		    <m:cn>79</m:cn>
		  </m:uplimit>
		  <m:lowlimit>
		    <m:cn>-79</m:cn>
		  </m:lowlimit>
		  <m:apply>
		    <m:times/>
		    <m:msub>
		      <m:mi>c</m:mi>
		      <m:mi>n</m:mi>
		    </m:msub>
		    <m:apply>
		      <m:exp/>
		      <m:apply>
			<m:times/>
			<m:imaginaryi/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>ω</m:mi>
			      <m:mn>0</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
			<m:ci>t</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  
	  The machine performed very well on all tests except those
	  involving <term>discontinuous functions</term>.  When a
	  square wave, like that shown in <cnxn target="four_four" strength="8"/>, was inputed into the machine, "wiggles"
	  around the discontinuities appeared, and even as the number
	  of Fourier coefficients approached infinity, the wiggles
	  never disappeared - these can be seen in the last plot in
	  <cnxn target="four_four" strength="8"/>.  J. Willard Gibbs
	  first explained this phenomenon in 1899, and therefore these
	  discontinuous points are referred to as <term>Gibbs
	  Phenomenon</term>.	  
	</para>
      </section>

    </section>

    <section id="main">
      <name>Explanation</name>
      
      <para id="m_p1">
	We begin this discussion by taking a signal with a finite
	number of discontinuities (like a <term>square pulse</term>)
	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
	<term>nonuniform convergence</term>.
      </para>

      <para id="m_p2">
	Below we will use the square wave, along with its Fourier
	Series representation, and show several figures that reveal
	this phenomenon more mathematically.
      </para>

      <section id="sub1">
	<name>Square Wave</name>
	<para id="p_sub1">
	  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. 

	  <equation id="seriesrepresent">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">s</m:ci>
		  <m:ci>t</m:ci>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:ci>
		    <m:msub>
		      <m:mi>a</m:mi>
		      <m:mn>0</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:apply>
		    <m:sum/>
		    <m:bvar>
		      <m:ci>k</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>1</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:infinity/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:ci>
			<m:msub>
			  <m:mi>a</m:mi>
			  <m:mi>k</m:mi>
			</m:msub>
		      </m:ci>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:divide/>
			  <m:apply>
			    <m:times/>
			    <m:cn>2</m:cn>
			    <m:pi/>
			    <m:ci>k</m:ci>
			    <m:ci>t</m:ci>
			  </m:apply>
			  <m:ci>T</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:sum/>
		    <m:bvar>
		      <m:ci>k</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>1</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:infinity/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:ci>
			<m:msub>
			  <m:mi>b</m:mi>
			  <m:mi>k</m:mi>
			</m:msub>
		      </m:ci>
		      <m:apply>
			<m:sin/>
			<m:apply>
			  <m:divide/>
			  <m:apply>
			    <m:times/>
			    <m:cn>2</m:cn>
			    <m:pi/>
			    <m:ci>k</m:ci>
			    <m:ci>t</m:ci>
			  </m:apply>
			  <m:ci>T</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	</para>	
      </section>

      <section id="sub2">
	<name>Example</name>
	<para id="p_sub2">
	  <cnxn target="four_four"/> shows several Fourier series <cnxn document="m0041" strength="8">approximation of the square
	    wave</cnxn> using a varied number of terms, denoted by
	    <m:math><m:ci>K</m:ci></m:math>:
	</para>

	<figure id="four_four">
	  <name>Fourier series approximation of a square wave</name>
	  <media type="image/png" src="fourier4.png"/>
	  <caption>Fourier series approximation to
	    <m:math>
	      <m:apply>
		<m:ci type="fn">sq</m:ci>
		<m:ci>t</m:ci>
	      </m:apply>
	    </m:math>.  The number of terms in the Fourier sum is
	    indicated in each plot, and the square wave is shown as a
	    dashed line over two periods.
	  </caption>
	</figure>

	<para id="para1">
	  When comparing the square wave to its Fourier series
	  representation in <cnxn target="four_four" strength="9"/>,
	  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 <cnxn target="four_four" strength="9"/> does
	  reveal a potential issue: Does the Fourier series really
	  equal the square wave at <emphasis>all</emphasis> values of
	  <m:math display="inline"><m:ci>t</m:ci></m:math>? 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 <link src="http://www-groups.dcs.st-and.ac.uk/~history/Mathematicians/Fourier.html">
	  Fourier</link> 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.
	</para>

	<para id="para2">
	  The extraneous peaks in the square wave's Fourier series
	  <emphasis>never</emphasis> disappear; they are termed
	  <term>Gibb's phenomenon</term> after the American physicist
	  Josiah Willard Gibbs. They occur whenever the signal is
	  discontinuous, and will always be present whenever the
	  signal has jumps.
	</para>

      </section>

      <section id="equal">
	<name>Redefine Equality</name>
	<para id="p_eq">
	  Let's return to the question of equality; how can the equal
	  sign in the <cnxn target="sine" document="m0039">definition
	  of the Fourier series</cnxn> be justified? The partial
	  answer is that pointwise--each and every value of

	  <m:math display="inline">
	    <m:ci>t</m:ci> </m:math>--equality is
	  <emphasis>not</emphasis> guaranteed. What mathematicians
	  later in the nineteenth century showed was that the rms
	  error of the Fourier series was always zero.

	  <equation id="eqn1">
	    <m:math display="block">
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:limit/>
		  <m:bvar><m:ci>K</m:ci></m:bvar>
		  <m:lowlimit><m:infinity/></m:lowlimit>
		  <m:apply>
		    <m:ci type="fn">rms</m:ci>
		    <m:ci><m:msub>
			<m:mi>ε</m:mi>
			<m:mi>K</m:mi>
		      </m:msub></m:ci>
		  </m:apply>
		</m:apply>
		<m:cn>0</m:cn>
	      </m:apply>
	    </m:math>
	  </equation>

	  What this means is that the difference between an actual signal
	  and its Fourier series representation may not be zero, but the
	  square of this quantity has <emphasis>zero</emphasis> integral!
	  It is through the eyes of the rms value that we define equality:
	  Two signals

	  <m:math display="inline">
	    <m:apply>
	      <m:ci type="fn"><m:msub>
		  <m:mi>s</m:mi>
		  <m:mn>1</m:mn>
		</m:msub></m:ci>
	      <m:ci>t</m:ci>
	    </m:apply>
	  </m:math>,

	  <m:math display="inline">
	    <m:apply>
	      <m:ci type="fn"><m:msub>
		  <m:mi>s</m:mi>
		  <m:mn>2</m:mn>
		</m:msub></m:ci>
	      <m:ci>t</m:ci>
	    </m:apply>
	  </m:math>

	  are said to be equal in the <term>mean square </term> if

	  <m:math display="inline">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">rms</m:ci>
		<m:apply><m:minus/>
		  <m:ci><m:msub>
		      <m:mi>s</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub></m:ci>
		  <m:ci><m:msub>
		      <m:mi>s</m:mi>
		      <m:mn>2</m:mn>
		    </m:msub></m:ci>
		</m:apply>
	      </m:apply>
	      <m:cn>0</m:cn>
	    </m:apply>
	  </m:math>. These signals are said to be equal
	  <term>pointwise</term> if

	  <m:math display="inline">
	    <m:apply><m:eq/>
	      <m:apply>
		<m:ci type="fn"><m:msub>
		    <m:mi>s</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub></m:ci>
		<m:ci>t</m:ci>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn"><m:msub>
		    <m:mi>s</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub></m:ci>
		<m:ci>t</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>

	  for all values of

	  <m:math display="inline">
	    <m:ci>t</m:ci> </m:math>.  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.
	</para>
      </section><para id="element-739"><media type="application/x-labviewrpvi80" src="FFTSymbolic.llb">
		<param name="lvfppviname" value="FFT Symbolic.vi"/>
		<param name="width" value="650"/>
		<param name="height" value="425"/>
	</media></para>



    </section>
    
  </content>
</document>
