<?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="new0">
  <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/">Low-Pass Filter Implementation: Prelab</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.5</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2003/02/22</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2004/02/25 12:46:59 US/Central</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="butala">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Mark</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Butala</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">butala@uiuc.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="butala">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Mark</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Butala</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">butala@uiuc.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="rlmorris">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Robert</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">L.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Morrison</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">rlmorris@uiuc.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"/>
</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="iir">
      <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/">IIR Filter Design Methods</name>

      <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="iir_overview">
        <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/">Overview</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="p1">
          Implementing the narrow-band LPF using an IIR filter is
          probably the most difficult option to design but the most
          straightforward to implement.  One reason for the design
          difficulty stems from the fact that in order to get such a
          sharp response poles close to the unit circle are needed.
          These poles can then drift outside the unit circle and the
          system can then become unstable when finite precision
          effects are added.  Also, perfectly linear phase (constant
          group delay) cannot be realized using IIR filtering.
        </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"> 
          There are several approaches to designing an approximately
          linear phase IIR filter.  For example, an IIR filter could
          be run on blocks of samples in both the forward and reverse
          direction and the results of each block added together;
          using the filter in both directions would cancel the
          nonlinear phase response of the filter.  Also, iterative
          design methods exist to design filters that simultaneously
          minimize errors in magnitude and group delay.  Yet another
          approach is to design an IIR filter which approximates the
          desired magnitude response (e.g., an elliptic filter using
          the <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">ellip</code> command in MATLAB) and then
          design an IIR all-pass filter which compensates for the
          nonlinear phase.  This last approach is the one we will
          examine here.
        </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="iir_fdtoolkit">
        <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/">MATLAB Filter Design Toolbox</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="p3">
          The MATLAB Filter Design (FD) Toolbox contains algorithms
          used for optimal or near optimal design of filters subject
          to various constraints.  You can view a description of the
          toolbox and the functions it contains at this <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.mathworks.com/access/helpdesk/help/toolbox/filterdesign/filterdesign.shtml">link</link>.
          The FD Toolbox will be installed on the white Dell machine
          nearest the door in the ECE 320 lab.
        </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="iir_usingkit">
        <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/">Using the Filter Design Toolbox</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="p4">
          Although it is possible to design a very good LPF magnitude
          response using an elliptic filter, we do not have the
          advantage with the <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">ellip</code> command of
          being able to constrain the poles away from the unit circle
          to prevent instability.  Fortunately, the FD Toolbox
          provides a command called <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">iirlpnormc</code>
          which allows us to keep the poles within a circle of a
          specified radius.  Note that this command implements a
          least-<m:math display="inline"><m:mi>p</m:mi></m:math>'th
          algorithm.  The term least-<m:math display="inline"><m:mi>p</m:mi></m:math>'th signifies that
          the algorithm attempts to minimize a <m:math display="inline"><m:msub><m:mi>L</m:mi><m:mi>p</m:mi></m:msub></m:math>-norm
          error.  In the case of the magnitude response, the <m:math display="inline"><m:msub><m:mi>L</m:mi><m:mi>p</m:mi></m:msub></m:math>-norm
          error is given as
        </para>


        <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="eq1">
          <m:math>
            <m:reln>
              <m:eq/>
              <m:msub>
                <m:apply>
                  <m:abs/>
                  <m:mi>H</m:mi>
                </m:apply>
                <m:mi>p</m:mi>
              </m:msub>
              <m:msup>
                <m:mrow>
                  <m:mfrac>
                    <m:mn>1</m:mn>
                    <m:mi>2π</m:mi>
                  </m:mfrac>
                  <m:apply>
                    <m:int/>
                    <m:bvar><m:ci>ω</m:ci></m:bvar>
                    <m:lowlimit><m:cn>-π</m:cn></m:lowlimit>
                    <m:uplimit><m:ci>π</m:ci></m:uplimit>
                    <m:mrow>
                      <m:msup>
                        <m:apply>
                          <m:abs/>
                          <m:mrow>
                            <m:apply>
                              <m:ci type="fn">H</m:ci>
                              <m:ci>ω</m:ci>
                            </m:apply>
                            <m:mo>-</m:mo>
                            <m:apply>
                              <m:ci type="fn">
                                <m:msub>
                                  <m:mi>H</m:mi>
                                  <m:mi>d</m:mi>
                                </m:msub>
                              </m:ci>
                              <m:ci>ω</m:ci>
                            </m:apply>
                          </m:mrow>
                        </m:apply>
                        <m:mi>p</m:mi>
                      </m:msup>
                      <m:apply>
                        <m:ci type="fn">
                          <m:mi>W</m:mi>
                        </m:ci>
                        <m:ci>ω</m:ci>
                      </m:apply>
                    </m:mrow>
                  </m:apply>
                </m:mrow>
                <m:mfrac>
                  <m:mn>1</m:mn>
                  <m:mi>p</m:mi>
                </m:mfrac>
              </m:msup>
            </m:reln>
          </m:math>
        </equation>
        
        <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="p5">
          where <m:math display="inline"><m:mi>H</m:mi></m:math> is
          the actual frequency response, <m:math display="inline"><m:msub><m:mi>H</m:mi><m:mi>d</m:mi></m:msub></m:math>
          is the desired response, and <m:math display="inline"><m:mi>W</m:mi></m:math> is some weighting
          function.  Most of the time the weighting function used is
          one which equals 1 over the passband and stop-band and 0 in
          the transition band.  The role of <m:math display="inline"><m:mi>W</m:mi></m:math> in the above
          equation is similar to that used in FIR filter design
          (<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">remez</code>).  The relative weights in the
          stop-band and pass-band are set by <m:math display="inline"><m:mi>W</m:mi></m:math> and control the
          relative magnitude of the ripples in these bands.  Note that
          minimizing the <m:math display="inline"><m:msub><m:mi>L</m:mi><m:mn>2</m:mn></m:msub></m:math>-norm
          is equivalent to minimizing the RMS error in the magnitude.
          In contrast, the <m:math display="inline"><m:msub><m:mi>L</m:mi><m:mn>∞</m:mn></m:msub></m:math>-norm
          is equivalent to minimizing the maximum error over the
          frequencies of interest (why?).  In this lab we are
          concerned with minimizing the <m:math display="inline"><m:msub><m:mi>L</m:mi><m:mn>∞</m:mn></m:msub></m:math>-norm.
          Of course, we cannot use infinity in any of our computations
          so using a large number (e.g. 128) must suffice.
        </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="p6">
          Once our magnitude response has been selected, we need to
          perform group delay equalization to yield approximately
          constant group delay.  This can be done using the
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">iirgrpdelay</code> command in the FD Toolbox.
          Again, note that a least-<m:math display="inline"><m:mi>p</m:mi></m:math>th algorithm is used
          and that we can constrain the radius of the poles.  The
          resulting all-pass filter can be connected in series with
          the nonlinear phase low-pass filter created with
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">iirlpnormc</code> to complete the entire system.
        </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="p7">
          The FD Toolbox can also aid in analyzing quantization
          effects.  We suggest using <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">FDATool</code>, a
          convenient GUI for interacting with the FD Toolbox, to carry
          out the analysis.  See the internet documentation for more
          information on the functions available.  Of course, you may
          choose to do this by scaling and rounding as you have done
          in previous labs.  Note that even though MATLAB uses
          high-precision arithmetic you may find that for long IIR
          filters MATLAB has difficulty rendering frequency responses,
          etc.  Thus, you may find it useful to design a filter that
          has half the passband ripple, half the stop-band
          attenuation, etc. and implement it twice in your code to
          meet the specification.
        </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="p7a">
          Note that <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">FDAtool</code> and the filter design
          toolbox (<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">qfilt</code> function) can be used to
          analyze quantization effects on various filter structures,
          as well as on the FFT. The quantization parameters can be
          chosen and optimized in <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">FDAtool</code>. Also,
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">FDAtool</code> (with or without the filter
          design toolbox) can compute correct scaling to avoid
          overflow.
        </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="iir_structures">
        <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/">Implementation Structures</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="p8">
          There are several ways to implement an IIR filter.  One of
          these, a cascade of second-order systems, we have already
          seen.  An alternative is placing these second-order sections
          in parallel.  Another common implementation is a lattice
          structure (see any standard DSP textbook), which tends to be
          more resistant to finite word-length effects and may be more
          computationally efficient.  To examine your choices, as a
          starting point you should examine the MATLAB functions
          listed as "Linear System Transformations" when you type help
          signal at the command prompt (does not require the FD
          Toolbox).
        </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="p9">
          One of the difficult aspects of an IIR lattice is that
          although the lattice coefficients are in the interval
          (-1,1), the internals of the lattice can grow to be
          prohibitively large.  To compensate for this, an m-file
          (<code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">latcfiltn.m</code>) has been created that
          performs normalization after each lattice section to prevent
          overflow.  If you are interested in exploring a lattice
          implementation you may want to copy this m-file to your own
          directory and modify it to suit your needs.  Note that there
          are comments within the file to indicate where you might add
          checks for overflow conditions.
        </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="p9a">
          We suggest the use of <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">FDAtool</code> and
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dfilt</code> for structure transformations.
          The function <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dfilt</code> works also without
          the Filter Design Toolbox. It is also useful for evaluating
          cascade or parallel connections of sub-filters.  The MATLAB
          command <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fvtool</code> can be used to quickly
          evaluate frequency response of various filter structures.
        </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="p9b">
          Many extremely efficient structures for IIR filter
          implementations exist.  Two of special note are the
          following:
        </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="l9a">
          <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/">
            All-pass filter implementations with
            <m:math><m:mi>N</m:mi></m:math> multiplies for an order
            <m:math><m:mi>N</m:mi></m:math> filter (instead of
            <m:math><m:mi>2N</m:mi></m:math> multiplies for a cascade
            realization).  These are structurally all-pass, meaning
            that they remain all-pass even when their coefficients are
            quantized.  (S. Mitra, Digital Signal Processing,
            a Computer Based Approach, 2nd Ed., pp. 378-382).
          </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/">
            Parallel all-pass Realization of IIR transfer functions
            with <m:math><m:mi>N</m:mi></m:math> multiplies for an
            <m:math><m:mi>N</m:mi></m:math>'th order
            filter. (S. Mitra, Digital Signal Processing, a Computer
            Based Approach, 2nd Ed., pp. 401-405, and Sec. 9.9,
            pp. 629-633).
          </item>

        </list>
      </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="iir_questions">
        <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/">Questions</name>

        <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" type="enumerated">
          <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/">Generate an elliptic LPF using the command:
            
            <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
              [b,a]=ellip(4,.5,10,.1);
            </code>

            Using MATLAB commands, generate a cascaded second-order
            system implementation and a lattice implementation (don't
            worry about normalization if you don't want) of this
            system and compare their advantages and disadvantages -
            especially as they relate to implementation on the C5400.
          </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/">
            How close to the unit circle are the poles of the system
            from question 1?  Does this concern you?  Explore how much
            the poles moved in the 2 implementations of part 1.
          </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/">
            Use the <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">grpdelay</code> command to view the
            group delay for the filter in the passband.  Is it
            approximately linear?
          </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/">
            Why does minimizing the $L$-norm equate to minimizing the
            <m:math display="inline"><m:msub><m:mi>L</m:mi><m:mn>∞</m:mn></m:msub></m:math>-norm
            maximum error over a given frequency range?
          </item>
        </list>
      </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="iir_simulation">
        <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/">Simulation</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="p9z">
          Simulate the IIR system in MATLAB.  Compute the response of
          the system with appropriate test inputs.  Make sure to
          include side-effects due to finite precision in your
          simulation.
        </para>
      </section>
    </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="multistage">
      <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/">Multi-rate/Multi-stage</name>

      <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="multistage_reading">
        <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/">Reading Exercise</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="p10">
          Read through the following resources:

          <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="l2">
            <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/">"Optimum FIR Digital Filter Implementations for
            Decimation, Interpolation, and Narrow-Band Filtering," by
            Crochiere and Rabiner.  This is colloquial paper on the
            topic of multi-stage filter implementation.  The paper is
              available <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.ews.uiuc.edu/~ece320/crochiererabiner.pdf">here</link>.</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/">Course notes on multi-stage filter implementation by
            <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.ee.binghamton.edu/fowler/">Prof. Mark
            Fowler</link> from Binghamton University.  The notes are
            available <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.ews.uiuc.edu/~ece320/multistage.pdf">here</link>.</item>
          </list>
        </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="multirate_design">
        <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/">Design Exercises</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="p11">
          Given the filter specification given 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="m11056" strength="8">filter specification</cnxn>,
          answer the following questions:

          <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="l3">
            <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/">What is the maximum decimation factor that can be used?</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/">What is the average number of MACs per input sample
            that are required for a single stage
            implementation?</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/">What are the appropriate decimation and
            interpolation factors for a a two stage
            implementation?</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/">What are the appropriate pass-band and stop-band
            frequencies and maximum ripple for the overall filter at
            each stage?  Your answer will demonstrate that the use of
            multiple filter stages along with multi-rate signal
            processing can achieve a overall filter of lower order
            than just a single stage filter.</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/">Estimate the filter order for each stage.  We
            recommend using the MATLAB command
            <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">remezord</code>.  This algorithm frequently
            underestimates the filter order needed, but gives you a
            good starting point.  Verify that the filter
            specifications are met, i.e. pass-band and stop-band
            ripple and pass-band and stop-band band edge locations.
            Do this by passing the arguments returned by
            <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">remezord</code> to the MATLAB command
            <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">remez</code>.  Observe the frequency
            response of the system described by the filter
            coefficients returned by \texttt{remez} using the MATLAB
            command <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">freqz</code>.  If the specifications
            are not met, increase the order of the filter until the
            specifications are met.</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/">Determine the average number of MACs per sample for
            the two-stage implementation.  Which is more efficient,
            the single stage approach or the multistage
            approach?</item>
          </list>
        </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="multistage_simulation">
        <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/">Matlab Simulation</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="p12">
          Using your results from the previous part, simulate the
          two-stage multi-rate filter in MATLAB. Plot the frequency
          response of each stage's filter using
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">freqz</code> and determine the overall
          frequency response of your multi-rate system to verify that
          it meets the specifications. Since there is not a command
          for directly finding the frequency response plot of a
          multi-rate system in MATLAB, you will have to be a bit
          creative.
        </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="multirate_addition">
        <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/">Additional Questions (optional, but for your benefit)</name>
        
        <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="l4">
          <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/">Does it make a difference in which order the two
          decimations are done in a two-stage implementation?</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/">Could / would you add additional stages? Why or why
          not?</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/">Are quantization effects more or less pronounced in
          the multi-stage implementation compared to a direct
          implementation? Why or why not?</item>
        </list>
      </section>
    </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="fourier">
      <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-Based Filtering Methods</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="p15">
        It is possible to perform linear convolution quickly using the
        FFT.  This idea allows for the efficient implementation of a
        FIR filter when the number of filter coefficients and the
        length of the input sequences are large.
      </para>

      <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="fourier_questions">
        <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/">Questions</name>

        <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="l5">
          <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/">Read Lecture 49 of the ECE 310 Course Notes on "Block
          Convolution."  This lecture provides an excellent overview
          of two methods for efficiently performing convolution using
          the FFT: "Overlap and Add" and "Overlap and Save."  For a
          more in depth treatment of these methods, refer to
          Discrete-Time Signal Processing by Alan Oppenheim and Ronald
          Schafer.</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/">Simulate both an (1) overlap and add and an (2)
          overlap and save filtering implementation in MATLAB.  Your
          simulations should work for any choice of an FIR filter.
          The filter length M and block length L should be variable
          parameters.</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/">Verify that your simulated systems are working properly by
          comparing their performance with a direct FIR
          implementation.  Test using several FIR filter designs and
          appropriate test inputs.</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/">Derive expressions for the amount of computation (in
          terms of multiply accumulates) required per input sample for
          both the overlap and add and overlap and save
          implementations.  Plot the computation per sample as a
          function of the input block length (for a particular filter
          size M) for both schemes.  Is there a value of M for which
          the Direct FIR is always more efficient?  Derive an
          expression for the optimal block size L in terms of the
          filter length M for both implementations.</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/">In the DSP implementation, the input sequence is
          purely real.  The values of the imaginary components are all
          set to zero.  We can speed up the implementations further by
          exploiting the symmetry properties of the Fourier transform.
          These properties are stated as follows:

            <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="e3">
              <m:math>
                <m:reln>
                  <m:eq/>
                  <m:apply>
                    <m:fn><m:mi>DFT</m:mi></m:fn>
                    <m:apply>
                      <m:mi>ℜ</m:mi>
                      <m:apply>
                        <m:fn><m:mi>x</m:mi></m:fn>
                        <m:mi>n</m:mi>
                      </m:apply>
                    </m:apply>
                  </m:apply>
                  <m:apply>
                    <m:fn><m:mi>Even</m:mi></m:fn>
                    <m:apply>
                      <m:fn><m:mi>X</m:mi></m:fn>
                      <m:mi>ω</m:mi>
                    </m:apply>
                  </m:apply>
                </m:reln>
              </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="e4">
              <m:math>
                <m:reln>
                  <m:eq/>
                  <m:apply>
                    <m:fn><m:mi>DFT</m:mi></m:fn>
                    <m:mrow>
                      <m:mi>j</m:mi>
                      <m:apply>
                        <m:mi>ℑ</m:mi>
                        <m:apply>
                          <m:fn><m:mi>x</m:mi></m:fn>
                          <m:mi>n</m:mi>
                        </m:apply>
                      </m:apply>
                    </m:mrow>
                  </m:apply>
                  <m:apply>
                    <m:fn><m:mi>Odd</m:mi></m:fn>
                    <m:apply>
                      <m:fn><m:mi>X</m:mi></m:fn>
                      <m:mi>ω</m:mi>
                    </m:apply>
                  </m:apply>
                </m:reln>
              </m:math>
            </equation>

            Using these properties, determine how to get two FFT's for
            the price of one.  Implement this scheme in MATLAB, and
            verify that the operation is correct.
          </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/">Design a FIR filter that meets the filter
          specification given 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="m11056" strength="8">filter specification</cnxn>.  Lecture 38 of the
          ECE 310 notes on "Parks-McClellan" might be a good reference
          here.  Design an efficient implementation of this filter
          using the methods you explored above.  The MATLAB commands
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">remezord</code> and <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">remez</code>
          may be of great help.  Simulate this implementation in
          MATLAB, programming in such a way that you can easily
          convert your MATLAB simulation to assembly.  Find the number
          of computations per input for your method.
          </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/">
            What are the benefits and trade-offs of using the
            Fourier-based method in terms of accuracy of the filter
            specification, finite precision errors, and computational
            expense?  Compare with the IIR and multi-rate filter
            implementations.
          </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="p16">
          Be prepared to show all the necessary plots and MATLAB
          simulations as well as answers to all of the questions posed
          above to your T.A. as your prelab.
        </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="fourier_implementation">
        <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/">Implementation Issues</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="p17">
          Due to the limitations of the core file, it is not possible
          to take in more than 64 input samples from the A/D converter
          at a time (unless the core file is rewritten to accomplish
          this task).  Therefore, when implementing a Fourier-based
          filter, you should use the C skeleton from Lab 4 to perform
          the FFT on a large block of samples.  All of your filtering
          operations (i.e., the multiplications of DFT samples, the
          additions of the overlap, the discarding of samples) and
          function calls must be performed in assembly.  You will be
          graded on the number of cycles per input sample based on the
          portion of code in your assembly routine.
        </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="p18">
          You should use the <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fft.asm</code> routine
          provided in Lab 4 to perform the forward and reverse FFT's.
          You should study this file to determine how it works.  If
          you need to change the length of the FFT, you will first
          need to change the relevant parameters in your assembly file
          (i.e., <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">N</code>,
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">K_FFT_SIZE</code>,
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">K_LOGN</code>, and other variables).  You will
          also need to change the following parameters in the FFT
          file:
        </para>

        <code 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="block" id="list">
          K_TWID_TBL_SIZE
          K_TWID_IDX_3
        </code>

        <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="p19">
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">K_TWID_TBL_SIZE</code> is the size of the
          twiddle tables (how long should these be for a given FFT
          length?)  and <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">K_TWID_IDX_3</code> is the
          amount by which the program increments through the twiddle
          table during at the third stage of the FFT.  What is this
          increment for a given <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">N</code>?  Is
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fft.asm</code> a decimation in time or
          decimation in frequency algorithm?
        </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="p20">
          You will also need a modified twiddle table when you change
          the length of the FFT to use <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fft.asm</code> as
          written.  For a length 1024 FFT, the twiddle tables are
          length 512 each.  <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">TWIDDLE1</code> is a table
          of sine values from zero to <m:math display="inline"><m:mi>π</m:mi></m:math>, and
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">TWIDDLE2</code> is a table of cosine values
          from 
          <m:math display="inline">
            <m:mfrac>
              <m:mi>π</m:mi>
              <m:mn>2</m:mn>
            </m:mfrac>
          </m:math>
          to 
          <m:math display="inline">
            <m:mfrac>
              <m:mi>3π</m:mi>
              <m:mn>2</m:mn>
            </m:mfrac>
          </m:math>
          .  The support for the cosine and sine is different because
          <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">fft.asm</code> code uses the fact that
          <m:math>
            <m:reln>
              <m:eq/>
              <m:apply>
                <m:sin/>
                <m:apply>
                  <m:minus/>
                  <m:mi>θ</m:mi>
                </m:apply>
              </m:apply>
              <m:apply>
                <m:minus/>
                <m:apply>
                  <m:sin/>
                  <m:mi>θ</m:mi>
                </m:apply>
              </m:apply>
            </m:reln>
          </m:math>

          when performing computations.  If you want a length 64 FFT,
          you will need to ``decimate'' the twiddle table to length
          32, or in other words, only keep one out of every 16 lines
          in the twiddle tables and discard the rest.  We will provide
          a MATLAB function, <code xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">edit_twiddle.m</code> for this
          purpose.  The function call in this example would be:
        </para>

        <code 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="block" id="c2">
          edit_twiddle('TWIDDLE1','new_twiddle1',16)
        </code>

        <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="p21">
          You should verify that the new twiddle tables you generate
          indeed have 32 elements.  To perform an inverse FFT, you can
          use the standard FFT algorithm and then appropriately scale
          and shift the outputs.  Lecture 43 of the ECE 310 notes on
          the Discrete Fourier Transform suggests how this may be done
          (Property 3 of ``Properties of the DFT'').
        </para>
      </section>

    </section>
  </content>
  
</document>
