<?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="m10783">
  
  <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/">The Fast Fourier Transform (FFT)</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.4</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2002/08/05</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2004/06/02 10:07:40 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="jrom">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Justin</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Romberg</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">jrom@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="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="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="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: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/">Fast Fourier Transform</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fft</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fourier</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/">This module describes the fast Fourier Transform (FFT).</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/">
    <section 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="int">
      <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/">Introduction</name>
      <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">
	The Fast Fourier Transform (FFT) is an efficient O(NlogN)
	algorithm for calculating DFTs 

	<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="list1">
	  <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/">
	    originally discovered by Gauss in the early 1800's
	  </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/">
	    rediscovered by Cooley and Tukey at IBM in the 1960's
	  </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/">
	    C.S. Burrus, Rice University's very own Dean of
	    Engineering, literally "wrote the book" on fast DFT
	    algorithms.
	  </item>
	</list>

	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/" strength="8" document="m10250">FFT </cnxn>exploits symmetries 
        in the <m:math><m:ci>W</m:ci></m:math> matrix to take a "divide
	and conquer" approach.  We won't talk about the actual FFT
	algorithm here, see <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="m10250" strength="8">these
	notes</cnxn> if you are interested in reading a little more on
	the idea behind FFT.
      </para>
    </section>

    <section 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="sec2">
      <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/">Speed Comparison</name>      
      <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="para3">
	How much better is O(NlogN) than O(
	<m:math>
	  <m:apply>
	    <m:power/>
	    <m:ci>N</m:ci>
	    <m:cn>2</m:cn>
	  </m:apply>
	</m:math>)? 
      </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="fig1">
	<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="fft_f1.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/">
	  This figure shows how much slower the computation time
	  of an O(NlogN) process grows.
	</caption>
      </figure> 
      
      <!-- This CALS table template is generated by `table.el' version 1.5.32 -->
      <table xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" frame="all" id="table1">
	<tgroup xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" cols="6" align="left">
	  <thead xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" valign="top">
	    <row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:ci>N</m:ci></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:cn>10</m:cn></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:cn>100</m:cn></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:cn>1000</m:cn></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>6</m:cn></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>9</m:cn></m:apply></m:math>
	      </entry>
	    </row>
	  </thead>
	  <tbody xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" valign="top">
	    <row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:ci>N</m:ci><m:cn>2</m:cn></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		100
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>4</m:cn></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>6</m:cn></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>12</m:cn></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>18</m:cn></m:apply></m:math>
	      </entry>
	    </row>
	    
	    <row xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:times/><m:ci>N</m:ci><m:apply><m:log/><m:ci>N</m:ci></m:apply></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:cn>1</m:cn></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:cn>200</m:cn></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:cn>3000</m:cn></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:times/><m:cn>6</m:cn><m:apply><m:power/><m:cn>10</m:cn><m:cn>6</m:cn></m:apply></m:apply></m:math>
	      </entry>
	      <entry xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" align="center">
		<m:math><m:apply><m:times/><m:cn>9</m:cn><m:apply><m:power/><m:cn>10</m:cn><m:cn>9</m:cn></m:apply></m:apply></m:math>
	      </entry>
	    </row>
	  </tbody>
	</tgroup>
      </table>
            
      <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="para4">
	Say you have a 1 MFLOP machine (a million "floating point"
	operations per second). Let 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>N</m:ci>
	    <m:apply>
	      <m:times/>
	      <m:cn>1</m:cn>
	      <m:ci>million</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:power/>
	      <m:cn>10</m:cn>
	      <m:cn>6</m:cn>
	    </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="para5">
	An O(
	<m:math>
	  <m:apply>
	    <m:power/>
	    <m:ci>N</m:ci>
	    <m:cn>2</m:cn>
	  </m:apply>
	</m:math>) algorithm takes
	<m:math><m:apply><m:power/><m:cn>10</m:cn><m:cn>12</m:cn></m:apply></m:math>
	flors → 
	<m:math>
	  <m:apply>
	    <m:power/>
	    <m:cn>10</m:cn>
	    <m:cn>6</m:cn>
	  </m:apply>
	</m:math> seconds ≃ 11.5 days. 
      </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="para6">
	An O(
	<m:math>
	  <m:apply>
	    <m:times/>
	    <m:ci>N</m:ci>
	    <m:apply>
	      <m:log/>
	      <m:ci>N</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>) algorithm takes 
	<m:math>
	  <m:apply>
	    <m:times/>
	    <m:cn>6</m:cn>
	    <m:apply>
	      <m:power/>
	      <m:cn>10</m:cn>
	      <m:cn>6</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math> Flors → 6 seconds. 
	
	<note 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="note">
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>N</m:ci>
	      <m:apply>
		<m:times/>
		<m:cn>1</m:cn>
		<m:ci>million</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math> is <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/">not</term> unreasonable.</note>
      </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="example1">
	<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="exam1para1">
	  3 megapixel digital camera spits out 
	  <m:math>
	    <m:apply>
	      <m:times/>
	      <m:cn>3</m:cn>
	      <m:apply>
		<m:power/>
		<m:cn>10</m:cn>
		<m:cn>6</m:cn>
	      </m:apply>
	    </m:apply>
	  </m:math> 
	  
	  numbers for each picture. So for two
	  <m:math><m:ci>N</m:ci></m:math> point sequences
	  <m:math><m:apply><m:ci type="fn" class="discrete">f</m:ci><m:ci>n</m:ci></m:apply></m:math>
	  and <m:math><m:apply><m:ci type="fn" class="discrete">h</m:ci><m:ci>n</m:ci></m:apply></m:math>. If
	  computing

	  <m:math>
	    <m:apply>
	      <m:ci><m:mo>⊛</m:mo></m:ci>
	      <m:apply>
		<m:ci type="fn" class="discrete">f</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn" class="discrete">h</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math> directly: O(
	  <m:math>
	    <m:apply>
	      <m:power/>
	      <m:ci>N</m:ci>
	      <m:cn>2</m:cn>
	    </m:apply>
	  </m:math>) operations. 
	</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="exam1para2">
	  taking FFTs -- O(NlogN)
	</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="exam1para3">
	  multiplying FFTs -- O(N)
	</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="exam1para4">
	  inverse FFTs -- O(NlogN).
	</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="exam1para5">
	  the total complexity is O(NlogN).
	</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="exam1para6">	
	<note 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="note">
	  FFT + digital computer were almost completely responsible for
	  the "explosion" of DSP in the 60's. 
	</note>
	</para>
      </example>
	
      <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="pend">
	<note 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="note">
	  Rice was (and still is) one of the places to do research in
	  DSP.
	</note>
      </para>

    </section>      

  </content>
</document>
