<?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="m0503"> 
    <name>DFT: Fast Fourier Transform</name>

  <metadata>
  <md:version>2.7</md:version>
  <md:created>2000/07/18</md:created>
  <md:revised>2004/08/04 16:39:34.556 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="dhj">
      <md:firstname>Don</md:firstname>
      
      <md:surname>Johnson</md:surname>
      <md:email>dhj@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <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="richb">
      <md:firstname>Richard</md:firstname>
      <md:othername>G.</md:othername>
      <md:surname>Baraniuk</md:surname>
      <md:email>richb@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mariyah">
      <md:firstname>Mariyah</md:firstname>
      
      <md:surname>Poonawala</md:surname>
      <md:email>mariyah@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>fast Fourier transform</md:keyword>
    <md:keyword>FFT</md:keyword>
    <md:keyword>Cooley-Tukey</md:keyword>
  </md:keywordlist>

  <md:abstract>The DFT can be reduced from exponential time with the Fast
Fourier Transform algorithm.</md:abstract>
</metadata>
  <content>


    <para id="p1"> We now have a way of computing the spectrum for an
      arbitrary signal: The Discrete Fourier Transform <cnxn document="m0502" target="eqn1" strength="5">(DFT)</cnxn>
      computes the spectrum at <m:math mode="inline"><m:ci>N</m:ci></m:math> equally spaced frequencies
      from a length- <m:math mode="inline"><m:ci>N</m:ci></m:math>
      sequence. An issue that never arises in analog
      "computation," like that performed by a circuit, is
      how much work it takes to perform the signal processing
      operation such as filtering. In computation, this consideration
      translates to the number of basic computational steps required
      to perform the needed processing. The number of steps, known as
      the <term>complexity</term>, becomes equivalent to how long the
      computation takes (how long must we wait for an
      answer). Complexity is not so much tied to specific computers or
      programming languages but to how many steps are required on any
      computer. Thus, a procedure's stated complexity says that
      the time taken will be <term>proportional </term>to some
      function of the amount of data used in the computation and the
      amount demanded.  </para>

    <para id="p2">
      For example, consider the formula for the discrete Fourier
      transform.  For each frequency we chose, we must multiply each
      signal value by a complex number and add together the
      results. For a real-valued signal, each real-times-complex
      multiplication requires two real multiplications, meaning we
      have
      <m:math mode="inline">
	<m:apply><m:times/><m:cn>2</m:cn><m:ci>N</m:ci></m:apply>
      </m:math> multiplications to perform. To add the results
      together, we must keep the real and imaginary parts
      separate. Adding <m:math mode="inline"> <m:ci>N</m:ci></m:math>
      numbers requires <m:math mode="inline">
      <m:apply><m:minus/><m:ci>N</m:ci><m:cn>1</m:cn></m:apply>
      </m:math>
      additions. Consequently, each frequency requires

      <m:math mode="inline">
	<m:apply><m:eq/>
	  <m:apply><m:plus/>
	    <m:apply><m:times/><m:cn>2</m:cn><m:ci>N</m:ci></m:apply>
	    <m:apply><m:times/>
	      <m:cn>2</m:cn>
	      <m:apply><m:minus/><m:ci>N</m:ci><m:cn>1</m:cn></m:apply>
	    </m:apply>
	  </m:apply>
	  <m:apply><m:minus/>
	    <m:apply><m:times/><m:cn>4</m:cn><m:ci>N</m:ci></m:apply>
	    <m:cn>2</m:cn>
	  </m:apply>
	</m:apply>
      </m:math>
      basic computational steps. As we have <m:math mode="inline"><m:ci>N</m:ci></m:math> frequencies, the total
      number of computations is <m:math mode="inline">
      <m:apply><m:times/> <m:ci>N</m:ci> <m:apply><m:minus/>
      <m:apply><m:times/><m:cn>4</m:cn><m:ci>N</m:ci></m:apply>
      <m:cn>2</m:cn>
	  </m:apply>
	</m:apply>
      </m:math>.  
    </para> 

    <para id="p3">
      In complexity calculations, we only worry about what happens as
      the data lengths increase, and take the dominant
      term—here the
      <m:math mode="inline">
	<m:apply><m:times/>
	  <m:cn>4</m:cn>
	  <m:apply><m:power/><m:ci>N</m:ci><m:cn>2</m:cn></m:apply>
	</m:apply>
      </m:math> term—as reflecting how much work is involved in
      making the computation. As multiplicative constants don't
      matter since we are making a "proportional to"
      evaluation, we find the DFT is an <m:math mode="inline">
      <m:apply><m:ci>O</m:ci><m:apply><m:power/><m:ci>N</m:ci><m:cn>2</m:cn></m:apply></m:apply></m:math>
      computational procedure. This notation is read "order <m:math mode="inline"> <m:ci>N</m:ci></m:math>-squared".  Thus, if we
      double the length of the data, we would expect that the
      computation time to approximately quadruple.
    </para>

    <exercise id="ex1">
      <problem> <para id="p4">In making the complexity evaluation for
	the DFT, we assumed the data to be real.  Three questions
	emerge.  First of all, the spectra of such signals have
	conjugate symmetry, meaning that negative frequency components
	(<m:math mode="inline"> <m:apply><m:eq/> <m:ci>k</m:ci>
	      <m:list>
		<m:apply><m:plus/>
		  <m:apply><m:divide/><m:ci>N</m:ci><m:cn>2</m:cn></m:apply>
		  <m:cn>1</m:cn>
		</m:apply>
		<m:ci><m:mo>...</m:mo></m:ci>
		<m:apply><m:plus/><m:ci>N</m:ci><m:cn>1</m:cn></m:apply>
	      </m:list>
	    </m:apply>
	  </m:math> in the <cnxn document="m0502" target="eqn1" strength="5">DFT</cnxn>) can be computed from the
	  corresponding positive frequency components.  Does this
	  symmetry change the DFT's complexity?</para>
	<para id="p5">
	  Secondly, suppose the data are complex-valued; what is the
	  DFT's complexity now?
	</para>
	<para id="p6"> Finally, a less important but interesting
	  question is suppose we want <m:math mode="inline"><m:ci>K</m:ci></m:math> frequency values
	  instead of <m:math mode="inline"><m:ci>N</m:ci></m:math>;
	  now what is the complexity?
	</para>
      </problem>
      <solution>
	<para id="p7">When the signal is real-valued, we may only need
	  half the spectral values, but the complexity remains
	  unchanged. If the data are complex-valued, which demands
	  retaining all frequency values, the complexity is again the
	  same. When only <m:math mode="inline"><m:ci>K</m:ci></m:math> frequencies are
	  needed, the complexity is <m:math mode="inline"><m:apply><m:ci>O</m:ci><m:mi>KN</m:mi></m:apply>
	  </m:math>.</para>
      </solution>
    </exercise>


  </content>
</document>
