<?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="m10595">
  <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/">Difference Equation</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.4</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2002/05/23</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2003/07/24 10:45:45 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="mjhaag">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Michael</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Haag</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mjhaag@rice.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="mariyah">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Mariyah</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Poonawala</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mariyah@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="prash">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Prashant</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Singh</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">prash@ece.rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">(Blank Abstract)</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="intro">
      <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/">Introduction</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="p_intro">
	One of the most important concepts of DSP is to be able to
	properly represent the input/output relationship to a given LTI
	system.  A linear constant-coefficient <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">difference
	  equation</term> (LCCDE) serves as a way to express just this
	relationship in a discrete-time system.  Writing the sequence
	of inputs and outputs, which represent the characteristics of
	the LTI system, as a difference equation help in understanding
	and manipulating a system.
	
	<definition 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="diff_eqtn">
	  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">difference equation</term>
	  <meaning xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    An equation that shows the relationship between
	    consecutive values of a sequence and the differences among
	    them.  They are often rearranged as a recursive formula so
	    that a systems output can be computed from the input
	    signal and past outputs.
	  </meaning>
	  
	  <example 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="eg_DE_def">
	    <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="p_def_diff">
	      <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="eqtn_diff1">
		<m:math>
		  <m:apply>
		    <m:eq/>
		    <m:apply>
		      <m:plus/>
		      <m:apply>
			<m:ci type="fn" class="discrete">y</m:ci>
			<m:ci>n</m:ci>
		      </m:apply>
		      <m:apply>
			<m:times/>
			<m:cn>7</m:cn>
			<m:apply>
			  <m:ci type="fn" class="discrete">y</m:ci>
			  <m:apply>
			    <m:minus/>
			    <m:ci>n</m:ci>
			    <m:cn>1</m:cn>
			  </m:apply>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:apply>
			  <m:ci type="fn" class="discrete">y</m:ci>
			  <m:apply>
			    <m:minus/>
			    <m:ci>n</m:ci>
			    <m:cn>2</m:cn>
			  </m:apply>
			</m:apply>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:ci type="fn" class="discrete">x</m:ci>
			<m:ci>n</m:ci>
		      </m:apply>
		      <m:apply>
			<m:times/>
			<m:cn>4</m:cn>
			<m:apply>
			  <m:ci type="fn" class="discrete">x</m:ci>
			  <m:apply>
			    <m:minus/>
			    <m:ci>n</m:ci>
			    <m:cn>1</m:cn>
			  </m:apply>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:math>	
	      </equation>
	    </para>
	    
	  </example>
	</definition>
	
      </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="gen">
      <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/">General Formulas from the Difference Equation</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="p_gen1">
	As stated briefly in the definition above, a difference
	equation is a very useful tool in describing and calculating
	the output of the system described by the formula for a given
	sample <m:math><m:ci>n</m:ci></m:math>.  The key property of
	the difference equation is its ability to help easily find the
	transform,
	<m:math>
	  <m:apply>
	    <m:ci type="fn">H</m:ci>
	    <m:ci>z</m:ci>
	  </m:apply>
	</m:math>,
	of a system.  In the following two subsections, we will look at
	the general form of the difference equation and the general
	conversion to a z-transform directly from the difference
	equation.
      </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="gen_sub1">
	<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/">Difference Equation</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="p_gen_sub1">
	  The general form of a linear, constant-coefficient
	  difference  equation (LCCDE), is shown below:
	  
	  <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="lccde_eqtn">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<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:apply>
		      <m:ci>
			<m:msub>
			  <m:mi>a</m:mi>
			  <m:mi>k</m:mi>
			</m:msub>
		      </m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn" class="discrete">y</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:ci>k</m:ci>
		      </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>M</m:ci>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci>
			<m:msub>
			  <m:mi>b</m:mi>
			  <m:mi>k</m:mi>
			</m:msub>
		      </m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn" class="discrete">x</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:ci>k</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  We can also write the general form to easily express a
	  recursive output, which looks like this:

	  <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="lccde_eqtn2">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn" class="discrete">y</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:sum/>
		      <m:bvar>
			<m:ci>k</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>1</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:ci>N</m:ci>
		      </m:uplimit>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>a</m:mi>
			      <m:mi>k</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:apply>
			  <m:ci type="fn" class="discrete">y</m:ci>
			  <m:apply>
			    <m:minus/>
			    <m:ci>n</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>M</m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>b</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn" class="discrete">x</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  
	  From this equation, note that 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn" class="discrete">y</m:ci>
	      <m:apply>
		<m:minus/>
		<m:ci>n</m:ci>
		<m:ci>k</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math> represents the outputs and 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn" class="discrete">x</m:ci>
	      <m:apply>
		<m:minus/>
		<m:ci>n</m:ci>
		<m:ci>k</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math> represents the inputs.  The value of
	  <m:math><m:ci>N</m:ci></m:math> represents the
	  <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">order</term> of the difference equation and
	  corresponds to the memory of the system being represented.
	  Because this equation relies on past values of the output,
	  in order to compute a numerical solution, certain past outputs,
	  referred to as the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">initial conditions</term>, must be known.
	</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="gen_sub2">
	<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/">Conversion to Z-Transform</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="p_gen_sub2">
	  Using the above formula, 
	  <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/" target="lccde_eqtn" strength="8"/>, we can 
	  easily generalize the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">transfer function</term>, 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">H</m:ci>
	      <m:ci>z</m:ci>
	    </m:apply>
	  </m:math>, for any difference equation.  Below are the steps
	  taken to convert any difference equation into its transfer
	  function, <foreign xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">i.e.</foreign> z-transform.  The first
	  step involves taking 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="m0046" strength="7">Fourier Transform</cnxn> of all the terms 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/" target="lccde_eqtn" strength="8"/>.  Then we use
	  the linearity property to pull the transform inside the
	  summation and the time-shifting property of the z-transform
	  to change the time-shifting terms to exponentials.  Once
	  this is done, we arrive at the following equation:
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci>
		  <m:msub>
		    <m:mi>a</m:mi>
		    <m:mn>0</m:mn>
		  </m:msub>
		</m:ci>
	      </m:apply>
	      <m:cn>1</m:cn>
	    </m:apply>
	  </m:math>.
	  

	  <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="eq_gsub1">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">Y</m:ci>
		  <m:ci>z</m:ci>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:sum/>
		      <m:bvar>
			<m:ci>k</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>1</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:ci>N</m:ci>
		      </m:uplimit>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>a</m:mi>
			      <m:mi>k</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:apply>
			  <m:ci type="fn">Y</m:ci>
			  <m:ci>z</m:ci>
			</m:apply>
			<m:apply>
			  <m:power/>
			  <m:ci>z</m:ci>
			  <m:apply>
			    <m:minus/>
			    <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>M</m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>b</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn">X</m:ci>
			<m:ci>z</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:ci>z</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </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="eq_gsub2">
	    <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:divide/>
		  <m:apply>
		    <m:ci type="fn">Y</m:ci>
		    <m:ci>z</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn">X</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:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>M</m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>b</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:ci>z</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>	
		  <m:apply>
		    <m:plus/>
		    <m:cn>1</m:cn>
		    <m:apply>
		      <m:sum/>
		      <m:bvar>
			<m:ci>k</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>1</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:ci>N</m:ci>
		      </m:uplimit>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>a</m:mi>
			      <m:mi>k</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:apply>
			  <m:power/>
			  <m:ci>z</m:ci>
			  <m:apply>
			    <m:minus/>
			    <m:ci>k</m:ci>
			  </m:apply>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>	
	  
	</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="gensub3">
	<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/">Conversion to Frequency Response</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="p_gensub3">
	  Once the z-transform has been calculated from the difference
	  equation, we can go one step further to define the frequency
	  response of the system, or filter, that is being
	  represented by the difference equation.
	  
	  <note 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="note">
	    Remember that the reason we are dealing with these
	    formulas is to be able to aid us in filter design.  A LCCDE
	    is one of the easiest ways to represent FIR filters.  By
	    being able to find the frequency response, we will be able to
	    look at the basic properties of any filter represented by a
	    simple LCCDE.	    
	  </note>

	  Below is the general formula for the frequency response of a
	  z-transform.  The conversion is simple a matter of taking
	  the z-transform formula, 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">H</m:ci>
	      <m:ci>z</m:ci>
	    </m:apply>
	  </m:math>,
	  and replacing every instance of 
	  <m:math><m:ci>z</m:ci></m:math> 
	  with 
	  <m:math>
	    <m:apply>
	      <m:exp/>
	      <m:apply>
		<m:times/>
		<m:imaginaryi/>
		<m:ci>w</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>.

	  <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="eq_gensub3">
	    <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>
	  
	  Once you understand the derivation of this formula, look at
	  the module concerning <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="m10548">Filter Design
	  from the Z-Transform</cnxn> for a look into how all of these
	  ideas of 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="m10549" strength="8">Z-transform</cnxn>, Difference Equation, and
	  <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="m10556" strength="8"> Pole/Zero Plots</cnxn>
	  play a role in filter design.
	</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="examples">
      <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/">Example</name>

      <example 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="eg1">
	<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/">Finding Difference Equation</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="p_eg">
	  Below is a basic example showing the opposite of the steps
	  above: given a transfer function one can easily calculate the
	  systems difference 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="eg1_ex1">
	    <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:divide/>
		  <m:apply>
		    <m:power/>
		    <m:apply>
		      <m:plus/>
		      <m:ci>z</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:cn>2</m:cn>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <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:plus/>
		      <m:ci>z</m:ci>
		      <m:apply>
			<m:divide/>
			<m:cn>3</m:cn>
			<m:cn>4</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  Given this transfer function of a time-domain filter, we want
	  to find the difference equation.  To begin with, expand both
	  polynomials and divide them by the highest order 
	  <m:math><m:ci>z</m:ci></m:math>.
	  
	  <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="eg1_ex2">
	    <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:divide/>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:plus/>
		      <m:ci>z</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:plus/>
		      <m:ci>z</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <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:plus/>
		      <m:ci>z</m:ci>
		      <m:apply>
			<m:divide/>
			<m:cn>3</m:cn>
			<m:cn>4</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>

		<m:apply>
		  <m:divide/>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:power/>
		      <m:ci>z</m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:ci>z</m:ci>
		    </m:apply>
		    <m:cn>1</m:cn>
		  </m:apply>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:plus/>
		      <m:apply>
			<m:power/>
			<m:ci>z</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:ci>z</m:ci>
		      </m:apply>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:divide/>
		      <m:cn>3</m:cn>
		      <m:cn>8</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>

		<m:apply>
		  <m:divide/>
		  <m:apply>
		    <m:plus/>
		    <m:cn>1</m:cn>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:apply>
			<m:power/>
			<m:ci>z</m:ci>
			<m:cn>-1</m:cn>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:power/>
		      <m:ci>z</m:ci>
		      <m:cn>-2</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:plus/>
		      <m:cn>1</m:cn>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:divide/>
			  <m:cn>1</m:cn>
			  <m:cn>4</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:times/>
		      <m:apply>
			<m:divide/>
			<m:cn>3</m:cn>
			<m:cn>8</m:cn>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:ci>z</m:ci>
			<m:cn>-2</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  From this transfer function, the coefficients of the two
	  polynomials will be our 
	  <m:math><m:apply>
	      <m:ci>
		<m:msub>
		  <m:mi>a</m:mi>
		  <m:mi>k</m:mi>
		</m:msub>
	      </m:ci></m:apply>
	  </m:math> and 
	  <m:math><m:apply>
	      <m:ci>
		<m:msub>
		  <m:mi>b</m:mi>
		  <m:mi>k</m:mi>
		</m:msub>
	      </m:ci></m:apply>
	  </m:math> values found in the general difference equation
	  formula, <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/" target="lccde_eqtn" strength="8"/>.
	  Using these coefficients and the above form of the transfer
	  function, we can easily write the difference 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="eg1_eq3">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:ci type="fn" class="discrete">x</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:cn>2</m:cn>
		    <m:apply>
		      <m:ci type="fn" class="discrete">x</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn" class="discrete">x</m:ci>
		    <m:apply>
		      <m:minus/>
		      <m:ci>n</m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:ci type="fn" class="discrete">y</m:ci>
		      <m:ci>n</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:divide/>
			<m:cn>1</m:cn>
			<m:cn>4</m:cn>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn" class="discrete">y</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>n</m:ci>
			  <m:cn>1</m:cn>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>3</m:cn>
		      <m:cn>8</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn" class="discrete">y</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  In our final step, we can rewrite the difference equation in
	  its more common form showing the recursive nature of the system.

	  <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="eg1_eq4">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn" class="discrete">y</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:ci type="fn" class="discrete">x</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:cn>2</m:cn>
		    <m:apply>
		      <m:ci type="fn" class="discrete">x</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn" class="discrete">x</m:ci>
		    <m:apply>
		      <m:minus/>
		      <m:ci>n</m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>-1</m:cn>
		      <m:cn>4</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn" class="discrete">y</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>3</m:cn>
		      <m:cn>8</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn" class="discrete">y</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>n</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	</para>
      </example>
    </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="solve">
      <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/">Solving a LCCDE</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="p_solve">
	In order for a linear constant-coefficient difference equation
	to be useful in analyzing a LTI system, we must be able to
	find the systems output based upon a known input,
	<m:math>
	  <m:apply>
	    <m:ci type="fn">x</m:ci>
	    <m:ci>n</m:ci>
	  </m:apply>
	</m:math>, and a set of initial conditions.  Two common
	methods exist for solving a LCCDE: the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">direct
	  method</term> and the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">indirect method</term>, the later
	being based on the z-transform.  Below we will briefly discuss
	the formulas for solving a LCCDE using each of these methods.
      </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="direct_solve">
	<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/">Direct Method</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="p_direct">
	  The final solution to the output based on the direct method
	  is the sum of two parts, expressed in the following
	  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="eq_direct">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">y</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>y</m:mi>
			<m:mi>h</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>y</m:mi>
			<m:mi>p</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  The first part,  
	  <m:math><m:apply>
	      <m:ci type="fn">
		<m:msub>
		  <m:mi>y</m:mi>
		  <m:mi>h</m:mi>
		</m:msub>
	      </m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	  </m:math>, is referred to as the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">homogeneous
	    solution</term> and the second part,    
	  <m:math><m:apply>
	      <m:ci type="fn">
		<m:msub>
		  <m:mi>y</m:mi>
		  <m:mi>h</m:mi>
		</m:msub>
	      </m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	  </m:math>, is referred to as <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">particular
	    solution</term>.  The following method is very similar to
	  that used to solve many differential equations, so if you
	  have taken a differential calculus course or used
	  differential equations before then this should seem very
	  familiar.
	</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="homog_sol">
	  <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/">Homogeneous Solution</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="p_homo">
	    We begin by assuming that the input is zero, 
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">x</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:cn>0</m:cn>
	      </m:apply>
	    </m:math>.
	    
	    Now we simply need to solve the homogeneous difference
	    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="eq_hom1">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <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:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>a</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn" class="discrete">y</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:cn>0</m:cn>
		</m:apply>
	      </m:math>
	    </equation>

	    In order to solve this, we will make the assumption that
	    the solution is in the form of an exponential.  We will
	    use lambda, <m:math><m:ci>λ</m:ci></m:math>, to
	    represent our exponential terms.  We now have to solve the
	    following 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="eq_hom2">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <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:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>a</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:ci>λ</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:cn>0</m:cn>
		</m:apply>
	      </m:math>
	    </equation>
	    
	    We can expand this equation out and factor out all of the
	    lambda terms. This will give us a large polynomial in
	    parenthesis, which is referred to as the
	    <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">characteristic polynomial</term>.  The roots of this
	    polynomial will be the key to solving the homogeneous
	    equation.  If there are all distinct roots, then the
	    general solution to the equation will be 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="eq_homsol1">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>y</m:mi>
			<m:mi>h</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>1</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>2</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>2</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>  
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mi>N</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mi>N</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>  
		  </m:apply>
		</m:apply>
	      </m:math>
	    </equation>

	    However, if the characteristic equation contains multiple
	    roots then the above general solution will be slightly
	    different.  Below we have the modified version for an
	    equation where  
	    <m:math>
	      <m:ci>
		<m:msub>
		  <m:mi>λ</m:mi>
		  <m:mi>1</m:mi>
		</m:msub>
	      </m:ci>
	    </m:math> has <m:math><m:ci>K</m:ci></m:math> multiple
	    roots:
	    
	    <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="eq_homsol2">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <m:apply>
		    <m:ci type="fn">
		      <m:msub>
			<m:mi>y</m:mi>
			<m:mi>h</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>1</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>1</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:ci>n</m:ci>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>1</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:ci>n</m:ci>
			<m:cn>2</m:cn>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>1</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:ci>n</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>K</m:ci>
			  <m:cn>1</m:cn>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>

		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mn>2</m:mn>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mn>2</m:mn>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>  
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>C</m:mi>
			    <m:mi>N</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci>
			    <m:msub>
			      <m:mi>λ</m:mi>
			      <m:mi>N</m:mi>
			    </m:msub>
			  </m:ci>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>  
		  </m:apply>
		</m:apply>
	      </m:math>
	    </equation>

	  </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="part_sol">
	  <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/">Particular Solution</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="p_part">
	    The particular solution, 
	    <m:math>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>y</m:mi>
		    <m:mi>p</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	    </m:math>, will be any solution that will solve the
	    general difference 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="part_lccde_eqtn">
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <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:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>a</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn">
			  <m:msub>
			    <m:mi>y</m:mi>
			    <m:mi>p</m:mi>
			  </m:msub>
			</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</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>M</m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci>
			  <m:msub>
			    <m:mi>b</m:mi>
			    <m:mi>k</m:mi>
			  </m:msub>
			</m:ci>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn">x</m:ci>
			<m:apply>
			  <m:minus/>
			  <m:ci>n</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:math>
	    </equation>

	    In order to solve, our guess for the solution to  
	    <m:math>
	      <m:apply>
		<m:ci type="fn">
		  <m:msub>
		    <m:mi>y</m:mi>
		    <m:mi>p</m:mi>
		  </m:msub>
		</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	    </m:math> will take on the form of the input, 
	    <m:math>
	      <m:apply>
		<m:ci type="fn">x</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	    </m:math>.  After guessing at a solution to the above
	    equation involving the particular solution, one only
	    needs to plug the solution into the difference equation
	    and solve it out.
	  </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="z_method">
	<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/">Indirect Method</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="p_ind">
	  The indirect method utilizes the relationship between the
	  difference equation and z-transform, discussed <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/" target="gen" strength="8">earlier</cnxn>, to find a
	  solution.  The basic idea is to convert the difference
	  equation into a z-transform, as described <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/" target="gen_sub2" strength="8">above</cnxn>, to get the
	  resulting output, 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">Y</m:ci>
	      <m:ci>z</m:ci>
	    </m:apply>
	  </m:math>.
	  Then by inverse transforming this and using partial-fraction
	  expansion, we can arrive at the solution.
	</para>
	
      </section>

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