<?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:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="m11126">
  <name>Sampling Theory and Spline Interpolation</name>
  <metadata>
  <md:version>2.3</md:version>
  <md:created>2003/04/23</md:created>
  <md:revised>2003/09/24 16:54:55.075 GMT-5</md:revised>
  <md:authorlist>
    <md:author id="rebecca">
      <md:firstname>Rebecca</md:firstname>
      
      <md:surname>Willett</md:surname>
      <md:email>willett@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="charlet">
      <md:firstname>Charlet</md:firstname>
      
      <md:surname>Reedstrom</md:surname>
      <md:email>charlet@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="jago">
      <md:firstname>Adan</md:firstname>
      
      <md:surname>Galvan</md:surname>
      <md:email>jago@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="sujesh">
      <md:firstname>Sujesh</md:firstname>
      
      <md:surname>Sreedharan</md:surname>
      <md:email>sujesh@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="ixmocane">
      <md:firstname>Alena</md:firstname>
      <md:othername>Ixmocane</md:othername>
      <md:surname>Scott</md:surname>
      <md:email>oetting@stat.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="rebecca">
      <md:firstname>Rebecca</md:firstname>
      
      <md:surname>Willett</md:surname>
      <md:email>willett@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>Shannon</md:keyword>
    <md:keyword>samples</md:keyword>
    <md:keyword>analog</md:keyword>
    <md:keyword>sinc</md:keyword>
    <md:keyword>B-splines</md:keyword>
    <md:keyword>cardinal splines</md:keyword>
  </md:keywordlist>

  <md:abstract>In this module, Shannon's classical sampling theory is compared to digital to analog signal reconstruction using spline interpolation. In the spline method, the signal is reconstructed using sample-weighted cardinal splines as opposed to sample-weighted sinc functions.</md:abstract>
</metadata>

  <content>
    <section id="sec1">
      <name>Shannon's sampling theory</name>
      <para id="para1">
	<cnxn document="m11044">Shannon's sampling theory</cnxn> tells
	us that if we have a <cnxn document="m10400">bandlimited
	signal</cnxn> (
	<m:math>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math>) that has been sampled at the <cnxn document="m0090">Nyquist rate</cnxn>, then the signal can be
	reconstructed from its samples (
	<m:math>
	  <m:apply>
	    <m:ci type="fn" class="discrete">s</m:ci>
	    <m:ci>k</m:ci>
	  </m:apply>
	</m:math>) with the following relation:

	<equation id="eqn1">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:ci>x</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:integers/>
		  </m:apply>
		</m:condition>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn" class="discrete">s</m:ci>
		    <m:ci>k</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn">sinc</m:ci>
		    <m:apply>
		      <m:minus/>
		      <m:ci>x</m:ci>
		      <m:ci>k</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>

	This relation is frequently used in digital to analog
	converter. There are several desirable properties of the <cnxn document="m10790">sinc function</cnxn> that make this strategy
	effective. First of all, the sinc function vanishes at all
	integers except at the origin. Secondly,
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">sinc</m:ci>
	      <m:cn>0</m:cn>
	    </m:apply>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math>. As a result, if <m:math><m:ci>T</m:ci></m:math> is
	the sampling frequency, then 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">s</m:ci>
	      <m:apply>
		<m:times/>
		<m:ci>x</m:ci>
		<m:ci>T</m:ci>
	      </m:apply>
	    </m:apply>
	    <m:apply>
	      <m:ci type="fn" class="discrete">s</m:ci>
	      <m:ci>k</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>. The reconstruction of the sequence of samples
	<m:math>
	  <m:list>
	    <m:cn>1</m:cn>
	    <m:cn>2</m:cn>
	    <m:cn>3</m:cn>
	    <m:cn>3</m:cn>
	    <m:cn>1.5</m:cn>
	    <m:cn>0</m:cn>
	    <m:cn>1</m:cn>
	    <m:cn>4</m:cn>
	  </m:list>
	</m:math> can be seen in <cnxn target="fig1"/>.
	
	<figure id="fig1">
	  <name>Sinc Interpolation</name>
	  <media type="image/png" src="SincInterp.png"/>
	  <caption>
	    Bandlimited continuous signals can be reconstructed from
	    their samples using a linear combination of sinc
	    functions, where the sinc functions are weighted by the
	    sample values.
	  </caption>
	</figure>
      </para>

      <para id="para2">
	The disadvantage of this approach is that it depends on the
	initial assumption that the signal is bandlimited, but
	frequently we rely on only a finite number of samples, which
	cannot completely describe a bandlimited signal. As a result,
	we can only find an approximate estimate of the signal
	<m:math>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math>.
      </para>
    </section>

    <section id="sec2">
      <name>Signal Reconstruction with Cardinal Splines</name>
      <para id="para3">
	As described above, having only a finite number of samples
	leads to inaccuracies in estimating
	<m:math>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math>. Using <cnxn document="m11127">cardinal
	splines</cnxn> instead of sinc functions can lessen the
	magnitude of the errors. The 
	<m:math>
	  <m:ci><m:msup>
	      <m:mi>n</m:mi>
	      <m:mi>th</m:mi>
	    </m:msup></m:ci>
	</m:math>
	cardinal spline, 
	<m:math>
	  <m:apply>
	    <m:power/>
	    <m:ci>η</m:ci>
	    <m:ci>n</m:ci>
	  </m:apply>
	</m:math>, gives piecewise polynomial interpolation with order
	<m:math><m:ci>n</m:ci></m:math> polynomials. Like the sinc
	function, each cardinal spline vanishes at all integers except
	the origin, and 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:power/>
	      <m:apply>
		<m:ci type="fn">η</m:ci>
		<m:cn>0</m:cn>
	      </m:apply>
	      <m:ci>n</m:ci>
	    </m:apply>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math>. Furthermore
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:limit/>
	      <m:bvar><m:ci>n</m:ci></m:bvar>
	      <m:lowlimit>
		<m:infinity/>
	      </m:lowlimit>
	      <m:apply>
		<m:power/>
		<m:apply>
		  <m:ci type="fn">η</m:ci>
		  <m:ci>x</m:ci>
		</m:apply>
		<m:ci>n</m:ci>
	      </m:apply>
	    </m:apply>
	    <m:apply>
	      <m:ci type="fn">sinc</m:ci>
	      <m:ci>x</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>. This means that cardinal splines can be used for
	signal reconstruction from samples just as sinc functions are
	used. Specifically,

	<equation id="eqn2">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:ci>x</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:integers/>
		  </m:apply>
		</m:condition>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn" class="discrete">s</m:ci>
		    <m:ci>k</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:power/>
		    <m:apply>
		      <m:ci type="fn">η</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>x</m:ci>
			<m:ci>k</m:ci>
		      </m:apply>
		    </m:apply>
		    <m:ci>n</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
      </para>

      <para id="para4">
	The reconstruction of the sequence of samples 
	<m:math>
	  <m:list>
	    <m:cn>1</m:cn>
	    <m:cn>2</m:cn>
	    <m:cn>3</m:cn>
	    <m:cn>3</m:cn>
	    <m:cn>1.5</m:cn>
	    <m:cn>0</m:cn>
	    <m:cn>1</m:cn>
	    <m:cn>4</m:cn>
	  </m:list>
	</m:math> can be seen in <cnxn target="fig2"/>.

	<figure id="fig2">
	  <name>Cardinal Spline Interpolation</name>
	  <media type="image/png" src="SplineInterp.png"/>
	  <caption>
	    Bandlimited continuous signals can be reconstructed from
	    their samples using a linear combination of cardinal
	    splines, where the spline functions are weighted by the
	    sample values.
	  </caption>
	</figure>
      </para>

      <para id="para5">
	From images <cnxn target="fig1"/> and <cnxn target="fig2"/>,
	it may appear that the spline interpolation is smoother than
	the sinc interpolation. This is because the support of the
	cardinal splines is more compact than that of the sinc
	function. In fact, to compute the value of
	<m:math>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math> (when 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>x</m:ci>
	  </m:apply>
	</m:math> is a polynomial signal) with an error of less than
	<m:math><m:cn>1</m:cn></m:math>%, one would need 
	<m:math>
	  <m:apply>
	    <m:ci type="fn">O</m:ci>
	    <m:cn>100</m:cn>
	  </m:apply>
	</m:math> sinc functions, but just 
	<m:math>
	  <m:apply>
	    <m:plus/>
	    <m:ci>n</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math>
	B-splines for exact evaluation.
      </para>
    </section>  
  </content>
  
</document>
