<?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 xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Lab 2: Prelab (part 2)</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/">1.1</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2006/07/26 11:03:08.999 GMT-5</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2006/08/20 21:39:30.498 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="tbshen">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Thomas</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Shen</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">tbshen@uiuc.edu</md:email>
    </md:author>
      <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="dljones">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Douglas</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/">Jones</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dl-jones@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="tbshen">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Thomas</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Shen</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">tbshen@uiuc.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/">anti-aliasing</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">anti-imaging</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">downsample</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">DSP</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">filter design</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">MATLAB</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">multirate</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">sample-rate compressor</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">sample-rate expander</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">upsample</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">zero-placement</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">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 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="sec2b">
	<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/">Filter-Design 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="p6">
	  Using the zero-placement method, design the FIR filters for
	  the multirate system in <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="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 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="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 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">
	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 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">
	Design your filters by writing a MATLAB script to compute the
	filter coefficients from the given zero locations.  The 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/">poly</code> is very useful for this; type
	<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/">help poly</code> in MATLAB for details.
      </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">
        Once you have determined the coefficients of the filters, use
        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/">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>
