<?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="m10249">
  
  <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/">Discrete Fourier Transform (DFT)</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.26</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2001/08/08</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2007/06/05 15:31:43.491 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="prash">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Prashant</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Singh</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">prash@ece.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="jac3">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">John</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Austin</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Cottrell</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">jac3@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="mariyah">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Mariyah</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Poonawala</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mariyah@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="seejaie">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">CJ</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Ganier</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">seejaie@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="richb">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Richard</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">G.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Baraniuk</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">richb@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="mhutch">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Matthew</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Hutchinson</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mhutch@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/">DFT</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Discrete Fourier Transform</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Fourier Transform</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">The Fourier transform can be computed in discrete-time despite the
    complications caused by a finite signal and continuous frequency.</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="p1"> The discrete-time Fourier transform (and the
      continuous-time transform as well) can be evaluated when we have
      an analytic expression for the signal. Suppose we just have a
      signal, such as the speech signal used in the previous chapter,
      for which there is no formula. How then would you compute the
      spectrum?  For example, how did we compute a spectrogram such as
      the one shown 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/" document="m0049" target="spectrogram" strength="5">speech signal example</cnxn>?  The Discrete Fourier
      Transform (DFT) allows the computation of spectra from
      discrete-time data.  While in discrete-time we can
      <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/">exactly</emphasis> calculate spectra, for analog
      signals no similar exact spectrum computation exists. For
      analog-signal spectra, use must build special devices, which
      turn out in most cases to consist of A/D converters and
      discrete-time computations. Certainly discrete-time spectral
      analysis is more flexible than continuous-time spectral
      analysis.
    </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="p2">
      The formula for 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="m10247" target="eqn1" strength="5">DTFT</cnxn>      
      is a sum, which conceptually can be easily computed save for two
      issues.  
    </para>    
    
    <list 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="l1"><item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	<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/">Signal duration</emphasis>.
	The sum extends over the signal's duration, which must be
	finite to compute the signal's spectrum. It is exceedingly
	difficult to store an infinite-length signal in any case, so
	we'll assume that the signal extends over	
	<m:math>
	    <m:interval closure="closed">
	      <m:cn>0</m:cn>
	      <m:apply>
		<m:minus/>
		<m:ci>N</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	    </m:interval>
	</m:math>.
      </item>
      
      <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> <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/">Continuous frequency</emphasis>.  Subtler than
	the signal duration issue is the fact that the frequency
	variable is continuous: It may only need to span one period,
	like
	<m:math>
	    <m:interval closure="closed">
	      <m:apply>
		<m:minus/>
		<m:apply>
		  <m:divide/>
		  <m:cn>1</m:cn>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:cn>2</m:cn>
	      </m:apply>
	    </m:interval>
	</m:math>
	or 
	<m:math>
	    <m:interval closure="closed">
	      <m:cn>0</m:cn>
	      <m:cn>1</m:cn>
	    </m:interval>
	</m:math>, 
	but the DTFT formula as it stands requires evaluating the
	spectra 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> frequencies within a
	period. Let's compute the spectrum at a few frequencies; the
	most obvious ones are the equally spaced ones
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>f</m:ci>
	    <m:apply>
	      <m:divide/>
	      <m:ci>k</m:ci>
	      <m:ci>K</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>, 
	
	<m:math>
	  <m:apply>
	    <m:in/>
	    <m:ci>k</m:ci>
	    <m:set>
	      <m:cn>0</m:cn>
	      <m:ci>…</m:ci>
	      <m:apply>
		<m:minus/>
		<m:ci>K</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	    </m:set>
	  </m:apply>
	</m:math>.
      </item>
    </list>
    
    <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="p3"> 
      We thus define 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/">discrete Fourier transform</term> (DFT)
      to be  
      
      <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>
	  <m:apply>
	    <m:forall/>
	    <m:bvar>
	      <m:ci>k</m:ci>
	    </m:bvar>
	    <m:condition>
	      <m:apply>
		<m:in/>
		<m:ci>k</m:ci>
		<m:set>
		  <m:ci>0</m:ci>
		  <m:ci>…</m:ci>
		  <m:apply>
		    <m:minus/>
		    <m:ci>K</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:set>
	      </m:apply>
	    </m:condition>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">S</m:ci>
		<m:ci>k</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>n</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:apply>
		    <m:minus/>
		    <m:ci>N</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn">s</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:divide/>
			<m:apply>
			  <m:times/>
			  <m:imaginaryi/>
			  <m:cn>2</m:cn> 
			  <m:pi/> 
			  <m:ci>n</m:ci> 
			  <m:ci>k</m:ci>
			</m:apply>
			<m:ci>K</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>
      Here, 
      <m:math>
	<m:apply>
	  <m:ci type="fn">S</m:ci>
	  <m:ci>k</m:ci>
	</m:apply>
      </m:math>
      is shorthand for      
      <m:math>
	<m:apply>
	  <m:ci type="fn">S</m:ci>
	  <m:apply>
	    <m:exp/>
	    <m:apply>
	      <m:times/>
	      <m:imaginaryi/>
	      <m:cn>2</m:cn>
	      <m:pi/>
	      <m:apply>
		<m:divide/>
		<m:ci>k</m:ci>
		<m:ci>K</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math>.  
    </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="intro">We can compute the spectrum at as many equally spaced
      frequencies as we like.  Note that you can think about this
      computationally motivated choice as <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/">sampling</term> the
      spectrum; more about this interpretation later.  The issue now
      is how many frequencies are enough to capture how the spectrum
      changes with frequency.  One way of answering this question is
      determining an inverse discrete Fourier transform formula: given
      <m:math>
	<m:apply>
	  <m:ci type="fn">S</m:ci>
	  <m:ci>k</m:ci>
	</m:apply>
      </m:math>,

      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>k</m:ci>
	  <m:set>
	    <m:ci>0</m:ci>
	    <m:ci>…</m:ci>
	    <m:apply>
	      <m:minus/>
	      <m:ci>K</m:ci>
	      <m:cn>1</m:cn>
	    </m:apply>
	  </m:set>
	</m:apply>
      </m:math>
       how do we find 
      <m:math>
	<m:apply>
	  <m:ci type="fn">s</m:ci>
	  <m:ci>n</m:ci>
	</m:apply>
      </m:math>,
      
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>n</m:ci>
	  <m:set>
	    <m:ci>0</m:ci>
	    <m:ci>…</m:ci>
	    <m:apply>
	      <m:minus/>
	      <m:ci>N</m:ci>
	      <m:cn>1</m:cn>
	    </m:apply>
	  </m:set>
	</m:apply>
      </m:math>? 
      Presumably, the formula will be of the form      
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>n</m:ci>
	  </m:apply>
	  <m:apply>
	    <m:sum/>
	    <m:bvar>
	      <m:ci>k</m:ci>
	    </m:bvar>
	    <m:lowlimit>
	      <m:cn>0</m:cn>
	    </m:lowlimit>
	    <m:uplimit>
	      <m:apply>       
		<m:minus/>
		<m:ci>K</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	    </m:uplimit>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:ci type="fn">S</m:ci>
		<m:ci>k</m:ci>
	      </m:apply>
	      <m:apply>
		<m:exp/>
		<m:apply>
		  <m:divide/>
		  <m:apply>
		    <m:times/>
		    <m:imaginaryi/>
		    <m:cn>2</m:cn>
		    <m:pi/>
		    <m:ci>n</m:ci>
		    <m:ci>k</m:ci>
		  </m:apply>
		  <m:ci>K</m:ci>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math>.
      Substituting the DFT formula in this prototype inverse transform
      yields       
      
      <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="zerozerozerotwo">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">s</m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:sum/>
	      <m:bvar>
		<m:ci>k</m:ci>
	      </m:bvar>
	      <m:lowlimit>
		<m:cn>0</m:cn>
	      </m:lowlimit>
	      <m:uplimit>
		<m:apply>
		  <m:minus/>
		  <m:ci>K</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:uplimit>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>m</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:apply>
		    <m:minus/>
		    <m:ci>N</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn">s</m:ci>
		    <m:ci>m</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:times/>
			<m:imaginaryi/>
			<m:apply>
			  <m:divide/>
			  <m:apply>
			    <m:times/>
			    <m:cn>2</m:cn>
			    <m:pi/>
			    <m:ci>m</m:ci>
			    <m:ci>k</m:ci>
			  </m:apply>
			  <m:ci>K</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:times/>
		      <m:imaginaryi/>
		      <m:apply>
			<m:divide/>
			<m:apply>
			  <m:times/>
			  <m:cn>2</m:cn>
			  <m:pi/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
			<m:ci>K</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math> 
      </equation>
      
      Note that the orthogonality relation we use so often has a
      different character now.  
      
      <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="zerozerozerothree">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:sum/>
	      <m:bvar>
		<m:ci>k</m:ci>
	      </m:bvar>
	      <m:lowlimit>
		<m:cn>0</m:cn>
	      </m:lowlimit>
	      <m:uplimit>
		<m:apply>
		  <m:minus/>
		  <m:ci>K</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:uplimit>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:exp/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:times/>
		      <m:imaginaryi/>
		      <m:apply>
			<m:divide/>
			<m:apply>
			  <m:times/>
			  <m:cn>2</m:cn>
			  <m:pi/>
			  <m:ci>k</m:ci>
			  <m:ci>m</m:ci>
			</m:apply>
			<m:ci>K</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:exp/>
		  <m:apply>
		    <m:times/>
		    <m:imaginaryi/>
		    <m:apply>
		      <m:divide/>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:pi/>
			<m:ci>k</m:ci>
			<m:ci>n</m:ci>
		      </m:apply>
		      <m:ci>K</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	    <m:piecewise>
	      <m:piece>
		<m:ci>K</m:ci>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:eq/>
		    <m:ci>m</m:ci>
		      <m:set>			
			<m:ci>n</m:ci>
			<m:apply>
			  <m:ci><m:mo>±</m:mo></m:ci>
			  <m:ci>n</m:ci>
			  <m:ci>K</m:ci>
			</m:apply>
			<m:apply>
			  <m:ci><m:mo>±</m:mo></m:ci>		  
			  <m:ci>n</m:ci>
			  <m:apply>
			  <m:times/>
			  <m:cn>2</m:cn>
			  <m:ci>K</m:ci>
			</m:apply>
		      </m:apply>
		      <m:ci>…</m:ci>
		    </m:set>
		  </m:apply>
		</m:apply>
	      </m:piece>
	      <m:otherwise>
		<m:cn>0</m:cn>
	      </m:otherwise>
	    </m:piecewise>
	  </m:apply>
	</m:math> 
      </equation>
      
      We obtain nonzero value whenever the two indices differ by multiples
      of <m:math><m:ci>K</m:ci></m:math>. We can express this result as       
      <m:math>
	<m:apply>
	  <m:times/>
	  <m:ci>K</m:ci>
	  <m:apply>
	    <m:sum/>
	    <m:bvar>
	      <m:ci>l</m:ci>
	    </m:bvar>
	    <m:condition>
	      <m:ci>l</m:ci>
	    </m:condition>
	    <m:apply>
	      <m:ci type="fn">δ</m:ci>
	      <m:apply>
		<m:minus/>
		<m:apply>
		  <m:minus/>
		  <m:ci>m</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:ci>l</m:ci>
		  <m:ci>K</m:ci> 
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math>.  

      Thus, our formula becomes 
      <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="zerozerozerofour"> 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">s</m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:sum/>
	      <m:bvar>
		<m:ci>m</m:ci>
	      </m:bvar>
	      <m:lowlimit>
		<m:cn>0</m:cn>
	      </m:lowlimit>
	      <m:uplimit>
		<m:apply>
		  <m:minus/>
		  <m:ci>N</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:uplimit>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:ci type="fn">s</m:ci>
		  <m:ci>m</m:ci>
		</m:apply>
		<m:ci>K</m:ci>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>l</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:apply>
		      <m:minus/>
		      <m:infinity/>
		    </m:apply>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:infinity/>
		  </m:uplimit>
		  <m:apply>
		    <m:ci type="fn">δ</m:ci>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:minus/>
			<m:ci>m</m:ci>
			<m:ci>n</m:ci>
		      </m:apply>
		      <m:apply>
			<m:times/>
			<m:ci>l</m:ci>
			<m:ci>K</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math> 
      </equation>

      The integers <m:math><m:ci>n</m:ci></m:math> and
      <m:math><m:ci>m</m:ci></m:math> both range over
      <m:math>
	<m:apply>
        <m:set>
	  <m:cn>0</m:cn>	
	  <m:ci>…</m:ci>	
	  <m:apply>
	    <m:minus/>
	    <m:ci>N</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
        </m:set>
        </m:apply>
      </m:math>.        
      To have an inverse transform, we need the sum to be a
      <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/">single</emphasis> unit sample for
      <m:math>
	<m:ci>m</m:ci>
      </m:math>, 

      <m:math>
	<m:ci>n</m:ci>
      </m:math> 
      in this range. If it did not, then
      <m:math>
	<m:apply>
	  <m:ci type="fn">s</m:ci>
	  <m:ci>n</m:ci>
	</m:apply>
      </m:math>      
      would equal a sum of values, and we would not have a valid
      transform: Once going into the frequency domain, we could not
      get back unambiguously!  Clearly, the term
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>l</m:ci>
	  <m:cn>0</m:cn>
	</m:apply>
      </m:math>       
      always provides a unit sample (we'll take care of the factor of
      <m:math>
	<m:ci>K</m:ci>
      </m:math>      
      soon).  If we evaluate the spectrum 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/">fewer</emphasis> frequencies than the signal's
      duration, the term corresponding to
      <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>m</m:ci>
	  <m:apply>
	    <m:plus/>
	    <m:ci>n</m:ci>
	    <m:ci>K</m:ci>
	  </m:apply>
	</m:apply>
      </m:math> 
      will also appear for some values of 
      <m:math>
	<m:ci>m</m:ci>
      </m:math>, <m:math>
	<m:apply>
	  <m:eq/>
	  <m:ci>n</m:ci>
           <m:apply>
	    <m:set>
	      <m:cn>0</m:cn>
	      <m:ci>…</m:ci>
	      <m:apply>
		<m:minus/>
		<m:ci>N</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	    </m:set>
	  </m:apply>
	</m:apply>
      </m:math>. 
      This situation means that our prototype transform equals 
      <m:math>
	<m:apply>
	  <m:plus/>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:ci>n</m:ci>
	  </m:apply>
	  <m:apply>
	    <m:ci type="fn">s</m:ci>
	    <m:apply>
	      <m:plus/>
	      <m:ci>n</m:ci>
	      <m:ci>K</m:ci>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math> 
      for some values of 
      <m:math>
	<m:ci>n</m:ci>
      </m:math>.  
      The only way to eliminate this problem is to require 
      <m:math>
	<m:apply>
	  <m:geq/>
	  <m:ci>K</m:ci>
	  <m:ci>N</m:ci>
	</m:apply>
      </m:math>:        
      We <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/">must</emphasis> have at least as many frequency samples as
      the signal's duration.  In this way, we can return from the
      frequency domain we entered via the DFT.
    </para>

    <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="exer1a">
      <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="tester1">
	  When we have fewer frequency samples than the signal's
	  duration, some discrete-time signal values equal the sum of
	  the original signal values.  Given the sampling
	  interpretation of the spectrum, characterize this effect a
	  different way.
	</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="tester2">
	  This situation amounts to aliasing in the time-domain.
	</para>
      </solution>
    </exercise>


    <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="eqnintro"> 
      Another way to understand this requirement is to use the theory
      of linear equations.  If we write out the expression for the DFT
      as a set of linear equations,

      <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="zerozerozerofivea">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:plus/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:cn>0</m:cn>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	      <m:ci>…</m:ci>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>N</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:apply>
	    </m:apply>
	    <m:apply>
	      <m:ci type="fn">S</m:ci>
	      <m:cn>0</m:cn>
	    </m:apply>
	  </m:apply>       
	</m:math>
      </equation>

      
      <m:math display="block">
	<m:apply>
	  <m:eq/>
	  <m:apply>
	    <m:plus/>
	    <m:apply>
	      <m:ci type="fn">s</m:ci>
	      <m:cn>0</m:cn>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	      <m:apply>
		<m:exp/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:minus/>
		    <m:imaginaryi/>
		  </m:apply>
		  <m:apply>
		    <m:divide/>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		    </m:apply>
		    <m:ci>K</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	    <m:ci>…</m:ci>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>N</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:exp/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:minus/>
		    <m:imaginaryi/>
		  </m:apply>
		  <m:apply>
		    <m:divide/>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		      <m:apply>
			<m:minus/>
			<m:ci>N</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		    <m:ci>K</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	  <m:apply>
	    <m:ci type="fn">S</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:apply>
      </m:math>
      
      <m:math display="block">
	<m:ci>⋮</m:ci>
      </m:math>      

      
      <m:math display="block">
	<m:apply>
	  <m:eq/>
	  <m:apply>
	    <m:plus/>
	    <m:apply>
	      <m:ci type="fn">s</m:ci>
	      <m:cn>0</m:cn>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:cn>1</m:cn>
	      </m:apply>
	      <m:apply>
		<m:exp/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:minus/>
		    <m:imaginaryi/>
		  </m:apply>
		  <m:apply>
		    <m:divide/>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		      <m:apply>
			<m:minus/>
			<m:ci>K</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		    <m:ci>K</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	    <m:ci>…</m:ci>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:ci type="fn">s</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>N</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:exp/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:minus/>
		    <m:imaginaryi/>
		  </m:apply>
		  <m:apply>
		    <m:divide/>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		      <m:apply>
			<m:minus/>
			<m:ci>N</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		      <m:apply>
			<m:minus/>
			<m:ci>K</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		    <m:ci>K</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	  <m:apply>
	    <m:ci type="fn">S</m:ci>
	    <m:apply>
	      <m:minus/>
	      <m:ci>K</m:ci>
	      <m:cn>1</m:cn>
	    </m:apply>
	  </m:apply>
	</m:apply>
      </m:math>      

      we have 
      <m:math>
	<m:ci>K</m:ci>
      </m:math>
      equations in 
      <m:math>
	<m:ci>N</m:ci>
      </m:math>      
      unknowns if we want to find the signal from its sampled
      spectrum.  This requirement is impossible to fulfill if
      <m:math>
	<m:apply>
	  <m:lt/>
	  <m:ci>K</m:ci>
	  <m:ci>N</m:ci>
	</m:apply>
      </m:math>; 
      we must have 
      <m:math>
	<m:apply>
	  <m:geq/>
	  <m:ci>K</m:ci>
	  <m:ci>N</m:ci>
	</m:apply>
      </m:math>.        
      Our orthogonality relation essentially says that if we have a
      sufficient number of equations (frequency samples), the
      resulting set of equations can indeed be solved.  
    </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="conventional">
      By convention, the number of DFT frequency values
      <m:math>
	<m:ci>K</m:ci>
      </m:math> 
      is chosen to equal the signal's duration   
      <m:math>
	<m:ci>N</m:ci>
      </m:math>.  
      The discrete Fourier transform pair consists of

      <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="zerozerozerosixa">
	<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/">Discrete Fourier Transform Pair</name>
	<m:math> 
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">S</m:ci>
	      <m:ci>k</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:sum/>
	      <m:bvar>
		<m:ci>n</m:ci>
	      </m:bvar>
	      <m:lowlimit>
		<m:cn>0</m:cn>
	      </m:lowlimit>
	      <m:uplimit>
		<m:apply>
		  <m:minus/>
		  <m:ci>N</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:uplimit>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:ci type="fn">s</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:exp/>
		  <m:apply><m:minus/>
                     <m:apply><m:times/>
		      <m:imaginaryi/>
		      <m:apply><m:divide/>
		        <m:apply><m:times/>
			  <m:cn>2</m:cn>
			  <m:pi/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
		        </m:apply>
		        <m:ci>N</m:ci>
		      </m:apply>
		    </m:apply>
                  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>

      <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="zerozerozerosixb">
	<m:math> 
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">s</m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:ci>N</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>k</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:apply>
		    <m:minus/>
		    <m:ci>N</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn">S</m:ci>
		    <m:ci>k</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:times/>
		      <m:imaginaryi/>
		      <m:apply>
			<m:divide/>
			<m:apply>
			  <m:times/>
			  <m:cn>2</m:cn>
			  <m:pi/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
			<m:ci>N</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>
    </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="analysis_demo"><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="analysis_demo_1">
	Use this demonstration to perform DFT analysis of a signal.
      </para>
	<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="application/x-labviewrpvi80" src="DFTanalysis.llb">
		<param name="lvfppviname" value="DFT Analysis.vi"/>
		<param name="width" value="800"/>
		<param name="height" value="500"/>
	</media>
</example>

    <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="synthesis_demo"><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="synthesis_demo_1">
	Use this demonstration to synthesize a signal from a DFT sequence.
      </para>
	<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="application/x-labview-llb" src="DFT_Component_Manipulation.llb">
		<param name="viinfo" value="dft_synthesis.viinfo"/>
	</media>
</example>

  </content>
</document>
