<?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="new30">
  <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/">Limit Cycles</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/">2003/07/18 17:43:44 GMT-5</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2005/01/01 22:55:34.119 US/Central</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="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="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:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="kclarks">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Kyle</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Clarkson</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">kclarks@rice.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/">large-scale limit cycles</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">limit cycles</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">overflow</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">small-scale limit cycles</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">zero-input limit cycles</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Overflow can cause large-scale limit cycles in IIR filters.  Saturation arithmetic prevents zero-input limit cycles.  Small-scale limit cycles can arise from quantization in recursive filters.</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="section1">
      <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/">Large-scale limit cycles</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="para1">
	When overflow occurs, even otherwise stable filters may
    get stuck in a <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/">large-scale limit cycle</term>, which is a
    short-period, almost full-scale persistent filter output caused by overflow.
      </para>
      <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="example1">
	<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="para2">
	  Consider the second-order system
	  <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:cn>1</m:cn>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:minus/>
		    <m:cn>1</m:cn>
		    <m:apply>
		      <m:inverse/>
		      <m:ci>z</m:ci>
		    </m:apply>
		  </m:apply>
		  <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>-2</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  
	  <figure 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="figure1">
	    <media 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="image/png" src="fig1LimitCycles.png"/>
	  </figure>
	  
	  with zero input and initial state values
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn" class="discrete">
		  <m:msub>
		    <m:mi>z</m:mi>
		    <m:mn>0</m:mn>
		  </m:msub>
		</m:ci>
		<m:cn>0</m:cn>
	      </m:apply>
	      <m:cn>0.8</m:cn>
	    </m:apply>
	  </m:math>,
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn" class="discrete">
		  <m:msub>
		    <m:mi>z</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub>
		</m:ci>
		<m:cn>0</m:cn>
	      </m:apply>
	      <m:cn>-0.8</m:cn>
	    </m:apply>
	  </m:math>. Note
	  <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:ci type="fn" class="discrete">
		  <m:msub>
		    <m:mi>z</m:mi>
		    <m:mn>0</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:plus/>
		  <m:ci>n</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>.
	</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="para3">
	  The filter is obviously stable, since the magnitude of the poles is 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:divide/>
		<m:cn>1</m:cn>
		<m:apply>
		  <m:root/>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:apply>
	      <m:cn>0.707</m:cn>
	    </m:apply>
	  </m:math>, which is well inside the unit circle.
	  However, with wraparound overflow, note that
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn" class="discrete">y</m:ci>
		  <m:cn>0</m:cn>
		</m:apply>
		<m:apply>
		  <m:ci type="fn" class="discrete">
		    <m:msub>
		      <m:mi>z</m:mi>
		      <m:mn>0</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:cn>5</m:cn>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:minus/>
		      <m:apply>
			<m:divide/>
			<m:cn>4</m:cn>
			<m:cn>5</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:divide/>
		  <m:cn>6</m:cn>
		  <m:cn>5</m:cn>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:cn>5</m:cn>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>, and that 
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn" class="discrete">
		    <m:msub>
		      <m:mi>z</m:mi>
		      <m:mn>0</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:cn>2</m:cn>
		</m:apply>
		<m:apply>
		  <m:ci type="fn" class="discrete">y</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>4</m:cn>
		      <m:cn>5</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:divide/>
		      <m:cn>4</m:cn>
		      <m:cn>5</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>6</m:cn>
		    <m:cn>5</m:cn>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:divide/>
		  <m:cn>4</m:cn>
		  <m:cn>5</m:cn>
		</m:apply>
	      </m:apply>
	    </m:math>, so
	    <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:mrow>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>4</m:cn>
		      <m:cn>5</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:mo>,</m:mo>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:cn>5</m:cn>
		  </m:apply>
		  <m:mo>,</m:mo>
		  <m:apply>
		    <m:minus/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>4</m:cn>
		      <m:cn>5</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:mo>,</m:mo>
		  <m:apply>
		    <m:divide/>
		    <m:cn>4</m:cn>
		    <m:cn>5</m:cn>
		  </m:apply>
		  <m:mo>,</m:mo>
		  <m:ci>…</m:ci>
		</m:mrow>
	      </m:apply>
	    </m:math> even with zero input.
	</para>
      </example>
      <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="para4">
	  Clearly, such behavior is intolerable and must be
	  prevented. Saturation arithmetic has been proved to prevent
	  <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/">zero-input limit cycles</term>, which is one reason why all
          DSP microprocessors support this feature. In many applications,
	  this is considered sufficient protection. Scaling to prevent
	  overflow is another solution, if as well the inital state
	  values are never initialized to limit-cycle-producing
	  values. The normal-form structure also reduces the chance of
	  overflow.
      </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="section2">
      <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/">Small-scale limit cycles</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="para5">
	<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/">Small-scale limit cycles</term> are caused by quantization. Consider
	the system
	<figure 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="figure2">
	  <media 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="image/png" src="fig2LimitCycles.png"/>
	</figure>
	Note that when
	<m:math>
	  <m:apply>
	    <m:gt/>
	    <m:apply>
	      <m:times/>
	      <m:ci>α</m:ci>
	      <m:ci>
		<m:msub>
		  <m:mi>z</m:mi>
		  <m:mn>0</m:mn>
		</m:msub>
	      </m:ci>
	    </m:apply>
	    <m:apply>
	      <m:minus/>
	      <m:ci>
		<m:msub>
		  <m:mi>z</m:mi>
		  <m:mn>0</m:mn>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:divide/>
		<m:ci>
		  <m:msub>
		    <m:mi>Δ</m:mi>
		    <m:mi>B</m:mi>
		  </m:msub>
		</m:ci>
		<m:cn>2</m:cn>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>, rounding will quantize the output to the current
	level (with zero input), so the output will remain at this
	level forever. Note that the maximum amplitude of this
	"small-scale limit cycle" is achieved when
	<m:math display="block">
	  <m:apply>
	    <m:eq/>
	    <m:apply>
	      <m:times/>
	      <m:ci>α</m:ci>
	      <m:ci>
		<m:msub>
		  <m:mi>z</m:mi>
		  <m:mn>0</m:mn>
		</m:msub>
	      </m:ci>
	    </m:apply>
	    <m:apply>
	      <m:minus/>
	      <m:ci>
		<m:msub>
		  <m:mi>z</m:mi>
		  <m:mn>0</m:mn>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:divide/>
		<m:ci>
		  <m:msub>
		    <m:mi>Δ</m:mi>
		    <m:mi>B</m:mi>
		  </m:msub>
		</m:ci>
		<m:cn>2</m:cn>
	      </m:apply>
	    </m:apply>
	    <m:mo>⇒</m:mo>
	    <m:apply>
	      <m:eq/>
	      <m:ci>
		<m:msub>
		  <m:mi>z</m:mi>
		  <m:mi>max</m:mi>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:divide/>
		<m:ci>
		  <m:msub>
		    <m:mi>Δ</m:mi>
		    <m:mi>B</m:mi>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:times/>
		  <m:cn>2</m:cn>
		  <m:apply>
		    <m:minus/>
		    <m:cn>1</m:cn>
		    <m:ci>α</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:apply>
	</m:math>
	In a higher-order system, the small-scale limit cycles are
	oscillatory in nature. Any
	quantization scheme that never increases the magnitude of
	any quantized value prevents small-scale limit cycles. 

	<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/">Two's-complement truncation does
	  <emphasis xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">not</emphasis> do this; it increases the magnitude
	  of negative numbers.</note>
	
	However, this introduces greater error
	and bias. Since the level of the limit cycles is
	proportional to
	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>Δ</m:mi>
	      <m:mi>B</m:mi>
	    </m:msub>
	  </m:ci>
	</m:math>, they can be reduced by increasing the
	number of bits. Poles close to the unit circle increase the
	magnitude and likelihood of small-scale limit cycles.
      </para>
    </section>
  </content>
  
</document>
