<?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="m10815">
  <name>Multirate Filtering: Filter-Design Exercise in MATLAB</name>
  <metadata>
  <md:version>2.6</md:version>
  <md:created>2002/08/14</md:created>
  <md:revised>2003/08/01 10:34:56.598 GMT-5</md:revised>
  <md:authorlist>
    <md:author id="appadwed">
      <md:firstname>Swaroop</md:firstname>
      
      <md:surname>Appadwedula</md:surname>
      <md:email>appadwed@uiuc.edu</md:email>
    </md:author>
    <md:author id="dljones">
      <md:firstname>Douglas</md:firstname>
      <md:othername>L.</md:othername>
      <md:surname>Jones</md:surname>
      <md:email>dl-jones@uiuc.edu</md:email>
    </md:author>
    <md:author id="kramer">
      <md:firstname>Michael</md:firstname>
      <md:othername>L.</md:othername>
      <md:surname>Kramer</md:surname>
      <md:email>kramer@ifp.uiuc.edu</md:email>
    </md:author>
    <md:author id="moussa">
      <md:firstname>Dima</md:firstname>
      
      <md:surname>Moussa</md:surname>
      <md:email>dmoussa@uiuc.edu</md:email>
    </md:author>
    <md:author id="bwade">
      <md:firstname>Brian</md:firstname>
      
      <md:surname>Wade</md:surname>
      <md:email>bwade@uiuc.edu</md:email>
    </md:author>
    <md:author id="jake">
      <md:firstname>Jake</md:firstname>
      
      <md:surname>Janevitz</md:surname>
      <md:email>jake@janevitz.com</md:email>
    </md:author>
    <md:author id="dsachs">
      <md:firstname>Daniel</md:firstname>
      <md:othername>Grobe</md:othername>
      <md:surname>Sachs</md:surname>
      <md:email>sachs@uiuc.edu</md:email>
    </md:author>
    <md:author id="mjberry">
      <md:firstname>Matthew</md:firstname>
      <md:othername>J.</md:othername>
      <md:surname>Berry</md:surname>
      <md:email>mjberry@uiuc.edu</md:email>
    </md:author>
    <md:author id="markhaun">
      <md:firstname>Mark</md:firstname>
      <md:othername>A.</md:othername>
      <md:surname>Haun</md:surname>
      <md:email>markhaun@uiuc.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="mjberry">
      <md:firstname>Matthew</md:firstname>
      <md:othername>J.</md:othername>
      <md:surname>Berry</md:surname>
      <md:email>mjberry@uiuc.edu</md:email>
    </md:maintainer>
    <md:maintainer id="butala">
      <md:firstname>Mark</md:firstname>
      <md:othername>D.</md:othername>
      <md:surname>Butala</md:surname>
      <md:email>butala@uiuc.edu</md:email>
    </md:maintainer>
    <md:maintainer id="rlmorris">
      <md:firstname>Robert</md:firstname>
      <md:othername>L.</md:othername>
      <md:surname>Morrison</md:surname>
      <md:email>rlmorris@uiuc.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>anti-aliasing</md:keyword>
    <md:keyword>anti-imaging</md:keyword>
    <md:keyword>upsample</md:keyword>
    <md:keyword>downsample</md:keyword>
    <md:keyword>sample-rate compressor</md:keyword>
    <md:keyword>sample-rate expander</md:keyword>
    <md:keyword>multirate</md:keyword>
    <md:keyword>filter design</md:keyword>
    <md:keyword>zero-placement</md:keyword>
    <md:keyword>MATLAB</md:keyword>
    <md:keyword>DSP</md:keyword>
  </md:keywordlist>

  <md:abstract>You will design a low-pass finite impulse-response filter using the zero-placement method in MATLAB.  The filter can be used as an anti-aliasing and anti-imaging filter in a multirate system.</md:abstract>
</metadata>




  <content>
      <section id="sec2b">
	<name>Filter-Design Exercise</name>
	<para id="p6">
	  Using the zero-placement method, design the FIR filters for
	  the multirate system in <cnxn document="m10024" target="fig1">Multirate Filtering: Introduction</cnxn>.
	  Recall that the 
	<m:math>
	  <m:ci>z</m:ci>
	</m:math>-transform of a length-
	<m:math>
	  <m:ci>N</m:ci>
	</m:math> FIR filter is a polynomial in 
	<m:math>
	  <m:apply>
	    <m:power/>
	    <m:ci>z</m:ci>
	    <m:cn>-1</m:cn>
	  </m:apply>
	</m:math>, and that this polynomial can be factored into
	<m:math>
	  <m:apply>
	    <m:minus/>
	    <m:ci>N</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math> roots.
      </para>
      <equation id="eqn3">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:ci type="fn">H</m:ci>
	      <m:ci>z</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:plus/>
	      <m:ci><m:msub>
		  <m:mi>h</m:mi>
		  <m:mn>0</m:mn>
		</m:msub></m:ci>
	      <m:apply>
		<m:times/>
		<m:ci><m:msub>
		    <m:mi>h</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub></m:ci>
		<m:apply>
		  <m:power/>
		  <m:ci>z</m:ci>
		  <m:cn>-1</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:ci><m:msub>
		    <m:mi>h</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub></m:ci>
		<m:apply>
		  <m:power/>
		  <m:ci>z</m:ci>
		  <m:cn>-2</m:cn>
		</m:apply>
	      </m:apply>
	      <m:ci>⋯</m:ci>
	    </m:apply>
	    <m:apply>
	      <m:times/>
	      <m:apply>
		<m:minus/>
		<m:ci><m:msub>
		    <m:mi>z</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub></m:ci>
		<m:apply>
		  <m:power/>
		  <m:ci>z</m:ci>
		  <m:cn>-1</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:minus/>
		<m:ci><m:msub>
		    <m:mi>z</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub></m:ci>
		<m:apply>
		  <m:power/>
		  <m:ci>z</m:ci>
		  <m:cn>-1</m:cn>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:minus/>
		<m:ci><m:msub>
		    <m:mi>z</m:mi>
		    <m:mn>3</m:mn>
		  </m:msub></m:ci>
		<m:apply>
		  <m:power/>
		  <m:ci>z</m:ci>
		  <m:cn>-1</m:cn>
		</m:apply>
	      </m:apply>
	      <m:ci>⋯</m:ci>
	    </m:apply>
	  </m:apply>
	</m:math>
      </equation>

      <para id="p7">
	Use this relation to design a low-pass filter
	(for the anti-aliasing and anti-imaging filters of the multirate 
	system) by placing twelve
	complex zeros on the unit circle at
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:times/>
		<m:cn>3</m:cn>
		<m:pi/>
	      </m:apply>
	      <m:cn>8</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>,
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:pi/>
	      <m:cn>2</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>,
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:times/>
		<m:cn>5</m:cn>
		<m:pi/>
	      </m:apply>
	      <m:cn>8</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>, 
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:times/>
		<m:cn>3</m:cn>
		<m:pi/>
	      </m:apply>
	      <m:cn>4</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>, 
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:times/>
		<m:cn>7</m:cn>
		<m:pi/>
	      </m:apply>
	      <m:cn>8</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>, and 
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:pi/>
	  </m:apply>
	</m:math>.  This filter that you have just designed will
	serve for both FIR 1 and FIR 3.  For filter FIR 2 (operating
	at the decimated rate), use four equally-spaced zeros on the
	unit circle located at
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:pi/>
	      <m:cn>4</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math> and 
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:apply>
	      <m:divide/>
	      <m:apply>
		<m:times/>
		<m:cn>3</m:cn>
		<m:pi/>
	      </m:apply>
	      <m:cn>4</m:cn>
	    </m:apply>
	  </m:apply>
	</m:math>.  Be sure to adjust the resulting filter
	coefficients to ensure that the gain does not exceed one  
	at any frequency.
      </para>

      <para id="p8">
	Design your filters by writing a MATLAB script to compute the
	filter coefficients from the given zero locations.  The MATLAB
	function <code>poly</code> is very useful for this; type
	<code>help poly</code> in MATLAB for details.
      </para>

      <para id="p9">
        Once you have determined the coefficients of the filters, use
        MATLAB function <code>freqz</code> to plot the frequency
        responses.  You will find that the frequency response of these
        filters has a large gain.  Adjust the resulting filter
        coefficients to ensure that the largest frequency gain is less
        than or equal to one by dividing the coefficients by an
        appropriate value.  Do the frequency responses match your
        expectations based on the locations of the zeros in the
        z-plane?
      </para>
    </section>
  </content>
  
</document>
