<?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="m10548">

  <name>Filter Design using the Pole/Zero Plot of a Z-Transform</name>
  
  <metadata>
  <md:version>2.8</md:version>
  <md:created>2002/03/28</md:created>
  <md:revised>2003/07/09 14:05:19 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="mjhaag">
      <md:firstname>Michael</md:firstname>
      
      <md:surname>Haag</md:surname>
      <md:email>mjhaag@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="mariyah">
      <md:firstname>Mariyah</md:firstname>
      
      <md:surname>Poonawala</md:surname>
      <md:email>mariyah@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="prash">
      <md:firstname>Prashant</md:firstname>
      
      <md:surname>Singh</md:surname>
      <md:email>prash@ece.rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>filter</md:keyword>
    <md:keyword>pole</md:keyword>
    <md:keyword>zero</md:keyword>
  </md:keywordlist>

  <md:abstract>Describes how to design a general filter from the Z-Transform and it pole/zero plots.</md:abstract>
</metadata>

  <content>

  <section id="freq">
     <name>Estimating Frequency Response from Z-Plane</name>

     <para id="zp_freq">
	One of the motivating factors for analyzing the pole/zero
	plots is due to their relationship to the frequency response
	of the system.  Based on the position of the poles and zeros,
	one can quickly determine the frequency response.  This is a
	result of the correspondence between the frequency response
	and the transfer function evaluated on the unit circle in the
	pole/zero plots.  The frequency response, or DTFT, of the
	system is defined as:
       
     <equation id="freqr1">     
        <m:math>
	  <m:apply>
   	     <m:eq/>
             <m:apply>
		<m:ci type="fn">H</m:ci><m:ci>w</m:ci>
	     </m:apply>
             <m:apply>	         
		<m:csymbol definitionURL="http://cnx.rice.edu/cd/cnxmath.ocd#evaluateat"/>
		<m:bvar>
		  <m:ci>z</m:ci>
		</m:bvar>	
		<m:condition>
		  <m:apply>
		    <m:exp/>
		    <m:apply>
		      <m:times/>
		      <m:imaginaryi/>
		      <m:ci>w</m:ci>
		    </m:apply>		
		  </m:apply>
		</m:condition>
                <m:apply>
                  <m:ci type="fn">H</m:ci><m:ci>z</m:ci>	     
                </m:apply>
	     </m:apply>
	     <m:apply>
		<m:divide/>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>k</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:ci>0</m:ci>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:ci>M</m:ci>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:ci>
		      <m:msub>
			<m:mi>b</m:mi>
			<m:mi>k</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:apply>
		      <m:exp/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:times/>
			  <m:imaginaryi/>
			  <m:ci>w</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>k</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:ci>N</m:ci>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:ci>
		      <m:msub>
			<m:mi>a</m:mi>
			<m:mi>k</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:apply>
		      <m:exp/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:times/>
			  <m:imaginaryi/>
			  <m:ci>w</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>			  
		    </m:apply>
		  </m:apply>
		</m:apply>	
	      </m:apply>
	  </m:apply>
	</m:math>
     </equation>

	Next, by factoring the transfer function into poles and zeros
	and multiplying the numerator and denominator by
	<m:math><m:apply><m:exp/><m:apply><m:times/><m:imaginaryi/><m:ci>w</m:ci></m:apply></m:apply></m:math>
	we arrive at the following equations:

     <equation id="freqr2">
	<m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">H</m:ci><m:ci>w</m:ci>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:abs/>
		  <m:apply>
		    <m:divide/>
		    <m:ci>
		      <m:msub>
			<m:mi>b</m:mi>
			<m:mn>0</m:mn>
		      </m:msub>
		    </m:ci>
		    <m:ci>
		      <m:msub>
			<m:mi>a</m:mi>
			<m:mn>0</m:mn>
		      </m:msub>
		    </m:ci>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:divide/>
		  
		  <m:apply>
		    <m:product/>
		    <m:bvar>
		      <m:ci>k</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:ci>1</m:ci>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>M</m:ci>
		    </m:uplimit>		  
		    <m:apply>
		      <m:abs/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:exp/>
			  <m:apply>
			    <m:times/>
			    <m:imaginaryi/>
			    <m:ci>w</m:ci>
			  </m:apply>
			</m:apply>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>c</m:mi>
			      <m:mi>k</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
		      </m:apply>		  			
		    </m:apply>			
		  </m:apply>

		  <m:apply>
		    <m:product/>
		    <m:bvar>
		      <m:ci>k</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:ci>1</m:ci>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>N</m:ci>
		    </m:uplimit>		  
		    <m:apply>
		      <m:abs/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:exp/>
			  <m:apply>
			    <m:times/>
			    <m:imaginaryi/>
			    <m:ci>w</m:ci>
			  </m:apply>
			</m:apply>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>d</m:mi>
			      <m:mi>k</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
		      </m:apply>		  			
		    </m:apply>			
		    
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</equation>

	From <cnxn target="freqr2" strength="8"/> we have the
	frequency response in a form that can be used to interpret
	physical characteristics about the filter's frequency
	response. The numerator and denominator contain a product of
	terms of the form 
	<m:math><m:apply> 
	    <m:abs/>
	    <m:apply>
	      <m:minus/>
	      <m:apply><m:exp/><m:apply>
		  <m:times/>
		  <m:imaginaryi/>
		  <m:ci>w</m:ci>
		</m:apply></m:apply>
	      <m:ci>h</m:ci>
	    </m:apply>
	  </m:apply></m:math>,
	where <m:math><m:ci>h</m:ci></m:math> is either a zero, denoted by 
	<m:math><m:ci>
	    <m:msub>
	      <m:mi>c</m:mi>
	      <m:mi>k</m:mi>
	    </m:msub>
	  </m:ci></m:math>
	or a pole, denoted by <m:math><m:ci>
	    <m:msub>
	      <m:mi>d</m:mi>
	      <m:mi>k</m:mi>
	    </m:msub>
	  </m:ci></m:math>.  Vectors are commonly used to represent
	the term and its parts on the complex plane. The pole or zero,
	<m:math><m:ci>h</m:ci></m:math>, is a vector from the origin
	to its location anywhere on the complex plane and
	<m:math><m:apply>
	<m:exp/><m:apply><m:times/><m:imaginaryi/><m:ci>w</m:ci></m:apply>
	</m:apply></m:math> is a vector from the origin to its
	location on the unit circle. The vector connecting these two
	points, <m:math><m:apply> <m:abs/>
	  <m:apply>
	   <m:minus/>
	   <m:apply><m:exp/><m:apply>
		<m:times/>
		<m:imaginaryi/>
		<m:ci>w</m:ci>
	   </m:apply></m:apply>
	   <m:ci>h</m:ci>
	  </m:apply>
	</m:apply></m:math>, connects the pole or zero location to a
	place on the unit circle dependent on the value of
	<m:math><m:ci>w</m:ci></m:math>. From this, we can begin to
	understand how the magnitude of the frequency response is a
	ratio of the distances to the poles and zero present in the
	z-plane as <m:math><m:ci>w</m:ci></m:math> goes from zero to
	pi. These characteristics allow us to interpret
	<m:math><m:apply><m:abs/><m:apply><m:ci type="fn">H</m:ci><m:ci>w</m:ci></m:apply></m:apply></m:math>
	as follows:

	<equation id="freq_simple">
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:apply>
		<m:abs/>
		<m:apply>
		  <m:ci type="fn">H</m:ci><m:ci>w</m:ci>
		</m:apply>
	    </m:apply>
	    <m:apply>
	      <m:times/>
		<m:apply>
		  <m:abs/>
		  <m:apply>
		    <m:divide/>
		    <m:ci>
		      <m:msub>
			<m:mi>b</m:mi>
			<m:mn>0</m:mn>
		      </m:msub>
		    </m:ci>
		    <m:ci>
		      <m:msub>
			<m:mi>a</m:mi>
			<m:mn>0</m:mn>
		      </m:msub>
		    </m:ci>
		  </m:apply>
		</m:apply>
	      <m:apply>
		<m:divide/>
		<m:apply>
		  <m:times/>
		  <m:ci>∏</m:ci>
		  <m:ci>"distances from zeros"</m:ci>		
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:ci>∏</m:ci>
		  <m:ci>"distances from poles"</m:ci>		
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
	</equation>

	In conclusion, using the distances from the unit circle to the
	poles and zeros, we can plot the frequency response of the
	system.  As <m:math><m:ci>w</m:ci></m:math> goes from
	<m:math><m:cn>0</m:cn></m:math> to <m:math>
	  <m:apply>
	    <m:times/>
	    <m:cn>2</m:cn>
	    <m:pi/>
	  </m:apply>
	</m:math>, the following two properties, taken from the above
	    equations, specify how one should draw <m:math><m:apply>
	    <m:abs/>
	    <m:apply>
	      <m:ci type="fn">H</m:ci><m:ci>w</m:ci>
	    </m:apply>
	  </m:apply></m:math>.

	<list id="mag_freq" type="enumerated">
	  <name>While moving around the unit circle...</name>
   	  <item>
	    if close to a zero, then the magnitude is small.  If a
	    zero is on the unit circle, then the frequency response is
	    zero at that point.</item>
  	  <item>
	    if close to a pole, then the magnitude is large.  If a
	    pole is on the unit circle, then the frequency response
	    goes to infinity at that point.</item>
 	</list>

      </para>
    </section>


<!-- ####################################################### -->
<!-- #####################  NEW SECTION  ################### -->

    <section id="freq_draw">
     <name>Drawing Frequency Response from Pole/Zero Plot</name>

     <para id="draw1">
	Let us now look at several examples of determining the
	magnitude of the frequency response from the pole/zero plot of
	a z-transform.  If you have forgotten or are unfamiliar with
	pole/zero plots, please refer back to the <cnxn document="m10556" strength="9">Pole/Zero Plots</cnxn> module.
     </para>

    <example id="eg1">
	<para id="eg1-1">
	  In this first example we will take a look at the very simple
	  z-transform shown below:

	  <m:math display="block">
             <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>z</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      <m:apply>
		<m:plus/>
		<m:cn>1</m:cn>
		<m:apply>			
		  <m:power/>
		  <m:ci>z</m:ci>
		  <m:cn>-1</m:cn>
		</m:apply>	
	      </m:apply>
	    </m:apply>
  	  </m:math>
	  
	  <m:math display="block">	    
            <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">H</m:ci><m:ci>w</m:ci>
	      </m:apply>
	      <m:apply>	
		<m:plus/>
		<m:cn>1</m:cn>
		<m:apply>			 
		  <m:exp/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:times/>
		      <m:imaginaryi/>
		      <m:ci>w</m:ci>
		    </m:apply>
		  </m:apply>			 
		</m:apply>	  	       		 
	      </m:apply>
	    </m:apply>
	  </m:math>

	  For this example, some of the vectors represented by 	
	  <m:math><m:apply>
	      <m:abs/>
	      <m:apply>
		<m:minus/>
		<m:apply><m:exp/><m:apply>
		    <m:times/>
		    <m:imaginaryi/>
		    <m:ci>w</m:ci>
		  </m:apply></m:apply>
		<m:ci>h</m:ci>
	      </m:apply>
	    </m:apply></m:math>, for random values of
	  <m:math><m:ci>w</m:ci></m:math>, are explicitly drawn onto
	  the complex plane shown in the <cnxn target="eg1a_fig" strength="7">figure</cnxn> below. These vectors show how the
	  amplitude of the frequency response changes as
	  <m:math><m:ci>w</m:ci></m:math> goes from
	  <m:math><m:cn>0</m:cn></m:math> to
	  <m:math><m:apply><m:times/><m:cn>2</m:cn><m:pi/></m:apply></m:math>,
	  and also show the physical meaning of the terms in <cnxn target="freqr2" strength="9"/> above. One can see that
	  when
	  <m:math><m:apply><m:eq/><m:ci>w</m:ci><m:cn>0</m:cn></m:apply></m:math>,
	  the vector is the longest and thus the frequency response
	  will have its largest amplitude here.  As
	  <m:math><m:ci>w</m:ci></m:math> approaches
	  <m:math><m:pi/></m:math>, the length of the vectors decrease
	  as does the amplitude of
	  <m:math><m:apply><m:abs/><m:apply><m:ci type="fn">H</m:ci><m:ci>w</m:ci></m:apply></m:apply></m:math>. Since
	  there are no poles in the transform, there is only this one
	  vector term rather than a ratio as seen in <cnxn target="freqr2" strength="9"/>.
	</para>

    	<figure orient="horizontal" id="eg1_fig">
  	  <subfigure id="eg1_fig1">
		<name>Pole/Zero Plot</name>
    	    	<media type="image/jpg" src="filt_eg1_pz.jpg"/>  	
	  </subfigure>
  	  <subfigure id="eg1_fig2">
		<name>Frequency Response: |H(w)|</name>
		<media type="image/jpg" src="filt_eg1_fig.jpg"/>
  	  </subfigure>
	  <caption>
	    The first figure represents the pole/zero plot with a few
	    representative vectors graphed while the second shows the
	    frequency response with a peak at +2 and graphed between
	    plus and minus <m:math><m:pi/></m:math>.
	  </caption>
	</figure>
    </example>

     <example id="eg2">
     	<para id="eg2-1">
	   For this example, a more complex transfer function is
	   analyzed in order to represent the system's frequency
	   response.

	   <m:math display="block">
             <m:apply>
		<m:eq/>
 		<m:apply>
		  <m:ci type="fn">H</m:ci><m:ci>z</m:ci>
                </m:apply>
		<m:apply>
		<m:divide/>
		<m:ci>z</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>z</m:ci>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:cn>2</m:cn>
		  </m:apply>	  	     
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:minus/>
		  <m:cn>1</m:cn>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:power/>
		      <m:ci>z</m:ci>
		      <m:cn>-1</m:cn>
		    </m:apply>	
		  </m:apply>	  	       
		</m:apply>
	      </m:apply>
	    </m:apply>
  	  </m:math>
	  
	  <m:math display="block">	    
            <m:apply>
		<m:eq/>
 		<m:apply>
		  <m:ci type="fn">H</m:ci><m:ci>w</m:ci>
                </m:apply>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
	  	  <m:apply>
		  <m:minus/>
		  <m:cn>1</m:cn>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:exp/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:times/>
			  <m:imaginaryi/>
			  <m:ci>w</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>	
		  </m:apply>	  	       
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</para>
	
	<para id="eg2_figs">
	  Below we can see the two figures described by the above
	  equations.  The <cnxn target="eg2_fig1"/> represents the
	  basic pole/zero plot of the z-transform,
	  <m:math><m:apply><m:ci type="fn">H</m:ci><m:ci>w</m:ci></m:apply></m:math>.  <cnxn target="eg2_fig2"/> shows the magnitude of the frequency
	  response.  From the formulas and statements in the previous
	  section, we can see that when
	  <m:math><m:apply><m:eq/><m:ci>w</m:ci><m:cn>0</m:cn></m:apply></m:math>
	  the frequency will peak since it is at this value of
	  <m:math><m:ci>w</m:ci></m:math> that the pole is closest to
	  the unit circle.  The ratio from <cnxn target="freqr2" strength="9"/> helps us see the mathematics behind
	  this conclusion and the relationship between the distances
	  from the unit circle and the poles and zeros.  As
	  <m:math><m:ci>w</m:ci></m:math> moves from
	  <m:math><m:cn>0</m:cn></m:math> to <m:math><m:pi/></m:math>,
	  we see how the zero begins to mask the effects of the pole
	  and thus force the frequency response closer to
	  <m:math><m:cn>0</m:cn></m:math>.
	</para>

	<figure orient="horizontal" id="eg2_fig">
  	  <subfigure id="eg2_fig1">
		<name>Pole/Zero Plot</name>
    	    	<media type="image/jpg" src="filt_eg2_pz.jpg"/>	  
	  </subfigure>
  	  <subfigure id="eg2_fig2">
		<name>Frequency Response: |H(w)|</name>
		<media type="image/jpg" src="filt_eg2_freq.jpg"/>
  	  </subfigure>
	  <caption>
		The first figure represents the pole/zero plot while
		the second shows the frequency response with a peak at
		+2 and graphed between plus and minus
		<m:math><m:pi/></m:math>.
	  </caption>
	</figure>

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