<?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="m0041">

  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Fourier Series Approximation of a Square Wave</name>

  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2.15</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2000/07/24</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2007/07/15 16:49:07.024 GMT-5</md:revised>
  <md:authorlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="dhj">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Don</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Johnson</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dhj@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="dhj">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Don</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Johnson</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dhj@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="mrshawn">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Shawn</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Stewart</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mrshawn@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="bfite">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Benjamin</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Fite</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">bfite@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">approximation by Fourier series</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">equality of Fourier series</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Fourier series</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Gibb's phenomenon</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mean square equality</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">pointwise equality</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">rms</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">square wave</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">step function</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Shows how to use Fourier series to approximate a square wave, as opposed to the sinusoidal waves seen previously.</md:abstract>
</metadata>
  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">


    <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="introduction">
      The Fourier series representation of a signal, as expressed for
      a square wave by

      <equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" 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>

      says that the left and right sides are "equal". We need to
      investigate equality through an example.
    </para>

    <example xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="onlyexample">
      <figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fourpointfour">
	<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Fourier series approximation of a square wave</name>
	<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="fourier4.png"/>
	<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	  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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exampleparagraph">
	Let's find the spectrum of the square wave
	<m:math>
	  <m:apply>
	    <m:ci type="fn">sq</m:ci>
	    <m:ci>t</m:ci>
	  </m:apply>
	</m:math>. 	
	The expressions for the Fourier coefficients have the common
	form

	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fouriercoefficients"><m:math>
	    <m:apply>
	      <m:eq/>
	      <m:vector>
		<m:ci>
		  <m:msub>
		    <m:mi>a</m:mi>
		    <m:mi>k</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>
		  <m:msub>
		    <m:mi>b</m:mi>
		    <m:mi>k</m:mi>
		  </m:msub>
		</m:ci>
	      </m:vector>
	      <m:apply>
		<m:minus/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>2</m:cn>
		    <m:ci>T</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>t</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:apply>
			<m:divide/>
			<m:ci>T</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:uplimit>
		    <m:vector>
		      <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: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:vector>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>2</m:cn>
		    <m:ci>T</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>t</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:apply>
			<m:divide/>
			<m:ci>T</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>T</m:ci>
		    </m:uplimit>
		    <m:vector>
		      <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: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:vector>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>

	The cosine coefficients
	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>a</m:mi>
	      <m:mi>k</m:mi>
	    </m:msub>
	  </m:ci>
	</m:math>
	are all zero, and the sine coefficients are

	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="sinecoefficients">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>
		<m:msub>
		  <m:mi>b</m:mi>
		  <m:mi>k</m:mi>
		</m:msub>
	      </m:ci>
	      <m:piecewise>
		<m:piece>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:apply>
		      <m:times/>
		      <m:pi/>
		      <m:ci>k</m:ci>
		    </m:apply>
		  </m:apply>
		  <m:mtext>k is odd</m:mtext>
		</m:piece>
		<m:piece>
		  <m:cn>0</m:cn>
		  <m:mtext>k is even</m:mtext>
		</m:piece>
	      </m:piecewise>
	    </m:apply>
	  </m:math>
	</equation>

	Thus, the Fourier series for the square wave is

	<equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fourierseriessquarewave">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">sq</m:ci>
		<m:ci>t</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>k</m:ci>
		</m:bvar>
		<m:condition>
		  <m:apply>
		    <m:in/>
		    <m:ci>k</m:ci>
		    <m:set>
		      <m:cn>1</m:cn>
		      <m:cn>3</m:cn>
		      <m:ci>…</m:ci>
		    </m:set>
		  </m:apply>
		</m:condition>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:apply>
		      <m:times/>
		      <m:pi/>
		      <m:ci>k</m:ci>
		    </m:apply>
		  </m:apply>
		  <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:math>
	</equation>

	As we see in <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="fourpointfour" strength="9"/>, the
	Fourier series requires many more terms to provide the same
	quality of approximation as we found with the 
	<cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m0061" target="fourier" strength="9">half-wave
	  rectified sinusoid</cnxn>. 
	We can verify that more terms are needed by considering the
	power spectrum and the approximation error shown in
	<cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="fourpointfive" strength="9"/>.
      </para>


      <figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fourpointfive">
	<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Power spectrum and rms error</name> 
	<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="fourier5.png"/> 
	<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	  The upper plot shows the power spectrum of the square wave,
	  and the lower plot the rms error of the finite-length
	  Fourier series approximation to the square wave. The
	  asterisk denotes the rms error when the number of terms
	  <m:math> 
	    <m:ci>K</m:ci>
	  </m:math>
	  in the Fourier series equals 99.
	</caption>
      </figure>


      <para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="conclusion">
	This difference between the two Fourier series results because
	the half-wave rectified sinusoid's Fourier coefficients are
	proportional to
	<m:math>
	  <m:apply>
	    <m:divide/>
	    <m:cn>1</m:cn>
	    <m:apply>
	      <m:power/>
	      <m:ci>k</m:ci>
	      <m:cn>2</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>
	while those of the square wave are proportional to
	<m:math>
	  <m:apply>
	    <m:divide/>
	    <m:cn>1</m:cn>
	    <m:ci>k</m:ci>
	  </m:apply>
	</m:math>. 
	In short, the square wave's coefficients decay more slowly
	with increasing frequency. Said another way, the square-wave's
	spectrum contains more power at higher frequencies than does
	the half-wave-rectified sinusoid.
      </para>
    </example>


    <exercise xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="exer1">
      <problem xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="problem_1">
	  Calculate the harmonic distortion for the square wave.
	</para>
      </problem>
      <solution xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="solutiontoproblem_1">
	  Total harmonic distortion in the square wave is
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:minus/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:power/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:cn>20</m:cn>
		<m:ci>%</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>.
	</para>
      </solution>
    </exercise>


    <figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="fig4.4">
      <media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" type="image/png" src="fourier4.png"/>
      <caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para1">
      When comparing the square wave to its Fourier series
      representation 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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="fig4.4" strength="9"/> does reveal a
      potential issue: Does the Fourier series really equal the square
      wave at <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" 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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="para2">
      The extraneous peaks in the square wave's Fourier series
      <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">never</emphasis> disappear; they are termed
      <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">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. Let's return to the question of equality; how can the
      equal sign in the 

      <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" target="sine" document="m0039" strength="6">definition of
	the Fourier series </cnxn> 

      be justified? The partial answer is that pointwise—each and
      every value of
      <m:math>
	<m:ci>t</m:ci> 
      </m:math>—equality 
      is <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">not</emphasis> guaranteed. What mathematicians
      later in the nineteenth century showed was that the rms error of
      the Fourier series was always zero.

      <equation xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" 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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">zero</emphasis> integral!
      It is through the eyes of the rms value that we define equality:
      Two signals
      <m:math>
	<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>
	<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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mean square</term> if
      <m:math>
	<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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">pointwise</term> if
      <m:math>
	<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><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, like we
      refrained from doing in defining the <cnxn xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" document="m0004" target="stepdef" strength="5">step function</cnxn>, 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>

  </content>
</document>
