<?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 (Thai Version)</name>
  <metadata>
  <md:version>2.6</md:version>
  <md:created>2004/10/31 14:54:54.334 US/Central</md:created>
  <md:revised>2004/10/31 14:55:20.857 US/Central</md:revised>
  <md:authorlist>
      <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="appadwed">
      <md:firstname>Swaroop</md:firstname>
      
      <md:surname>Appadwedula</md:surname>
      <md:email>appadwed@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:author id="jake">
      <md:firstname>Jake</md:firstname>
      
      <md:surname>Janevitz</md:surname>
      <md:email>jake@janovetz.com</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="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="bwade">
      <md:firstname>Brian</md:firstname>
      
      <md:surname>Wade</md:surname>
      <md:email>bwade@uiuc.edu</md:email>
    </md:author>
      <md:author id="jpfrantz">
      <md:firstname>Patrick</md:firstname>
      
      <md:surname>Frantz</md:surname>
      <md:email>jpfrantz@rice.edu</md:email>
    </md:author>
      <md:author id="Kriengchaipruck">
      <md:firstname>Kamolchanok</md:firstname>
      
      <md:surname>Kriengchaipruck</md:surname>
      <md:email>Kamolchanokkrieng@hotmail.com</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="jpfrantz">
      <md:firstname>Patrick</md:firstname>
      
      <md:surname>Frantz</md:surname>
      <md:email>jpfrantz@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="Kriengchaipruck">
      <md:firstname>Kamolchanok</md:firstname>
      
      <md:surname>Kriengchaipruck</md:surname>
      <md:email>Kamolchanokkrieng@hotmail.com</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">
	  ใช้วิธี zero-placement , ออกแบบ FIR filters สำหรับ 
	   multirate system ใน  <cnxn document="m10024" target="fig1">Multirate Filtering: Introduction</cnxn>.
	  ให้นึกถึง 	<m:math>  <m:ci>z</m:ci>
	</m:math>-transform ที่ มีความยาวของ FIR filter -
	<m:math>
	  <m:ci>N</m:ci>
	</m:math>เป็น  polynomial ในรูป 
	<m:math>
	  <m:apply>
	    <m:power/>
	    <m:ci>z</m:ci>
	    <m:cn>-1</m:cn>
	  </m:apply>
	</m:math>, โดยที่  polynomial ดังกล่าวสามารถแยกส่วนประกอบได้เป็นจำนวน
	<m:math>
	  <m:apply>
	    <m:minus/>
	    <m:ci>N</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math>
      </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">
	ใช้ความสัมพันธ์นี้ในการออกแบบ  low-pass filter
	(สำหรับ anti-aliasing และ anti-imaging filters ของ the multirate 
	system) โดยการแทนที่ complex zeros ทั้ง 12 ตัวบน  unit circle ที่
	<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>, และ 
	<m:math>
	  <m:apply>
	    <m:mo>±</m:mo>
	    <m:pi/>
	  </m:apply>
	</m:math>.  Filter ที่ออกแบบโดยวิธีนี้จะสามารถใช้ได้กับทั้ง
	 FIR 1 และ FIR 3.  สำหรับ filter FIR 2 (operating
	at the decimated rate), ใช้ equally-spaced zeros สี่ตัว บน 
	unit circle ที่ตำแหน่ง
	<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> และ
	<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>.  อย่าลืมปรับค่า  resulting filter
	coefficients เพื่อให้แน่ใจว่าค่า  gain จะไม่เกินค่า exceed one  
	at any frequency.
      </para>

      <para id="p8">
	ออกแบบ  filter ของคุณ โดยการเขียน  MATLAB script เพื่อคำนวณค่า 
	filter coefficients จากจุด zero location ที่ให้ไป.   MATLAB
	function <code>poly</code>จะช่วยได้  ให้พิมพ์คำว่า 
	<code>help poly</code> เพื่อเรียนรู้วิธีการใช้คำสั่ง
      </para>

      <para id="p9">
        เมื่อคุณเลือก  coefficients ที่จะใช้สำหรับ filter ได้แล้ว, ใช้
        MATLAB function <code>freqz</code> ในการสร้างกราฟ frequency
        responses.  คุณจะพบว่า ช่วง frequency response ของ
        filters เหล่านี้มี ช่วง  gain ที่มาก.  ทำการปรับค่า resulting filter
        coefficients เพื่อให้แน่ใจว่า ค่า  frequency gain ที่มากที่สุดมีค่าน้อยกว่า
        หรือเท่ากับ หนึ่ง โดยทำการหารค่า coefficients ด้วยค่าที่เหมาะสม
        ค่า frequency responses ที่ได้ตรงกับที่คาดไว้หรือไม่โดยอิงจาก ตำแหน่ง
       ศูนย์ใน  z-plane?
      </para>
    </section>
  </content>
  
</document>
