<?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="m10577">
  <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/">Linear-Phase Fir Filter Design By Least Squares</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.5</md:version>
  <md:created xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2002/05/08</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2003/03/28</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="selesi">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Ivan</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Selesnick</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">selesi@taco.poly.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="bfite">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Benjamin</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Fite</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">bfite@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="jago">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Adan</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Galvan</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">jago@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="selesi">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Ivan</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Selesnick</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">selesi@taco.poly.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/">FIR</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">least squares</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">This module describes the design of linear-phase FIR filters based on the square error criterion. It includes derivation and an example.
</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="linear1">
      <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/">Linear-Phase FIR Filter Design by Least Squares</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="linearpara1">
	This module describes the design of linear-phase FIR filters
	based on the square error criterion. We will see that FIR
	filters that minimize the square error can be found by solving
	a linear system of equations. This technique is
	straight-forward and is applicable to arbitrary desired
	frequency responses. In addition, linear constraints on the
	coefficients are easily included.
      </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="linearpara2">
	Linear-phase filter design by least squares has several
	advantages.

	<list 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="advantages">
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Optimal with respect to square error criterion.</item>
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Simple, non-iterative method.</item>
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	    Analytic solutions sometimes possible, otherwise solution
	    is obtained via solution to linear system of equations.
	  </item>
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Allows the use of a frequency dependent weighting
	  function.</item>
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Suitable for arbitrary 
	    <m:math display="inline">
	      <m:apply>
		<m:ci type="fn">D</m:ci>
		<m:ci>ω</m:ci>
	      </m:apply>
	    </m:math>
	    and
	    <m:math display="inline">
	      <m:apply>
		<m:ci type="fn">W</m:ci>
		<m:ci>ω</m:ci>
	      </m:apply>
	    </m:math>.
	  </item>
	  <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Easy to include arbitrary linear constraints.</item>
	</list>
      </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="deriv1">
	<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/">Derivation</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="derivpara1">
	  The weighted integral square error (or "
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>L</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	   error") is defined by

	  <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="derivequ1">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:ci>
		  <m:msub>
		    <m:mi>ε</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:int/>
		  <m:bvar>
		    <m:ci>ω</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:pi/>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">W</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:power/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:ci type="fn">A</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:ci type="fn">D</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  where

	  <list 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="list1">
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      <m:math>
		<m:apply>
		  <m:ci type="fn">A</m:ci>
		  <m:ci>ω</m:ci>
		</m:apply>
	      </m:math>  : the actual amplitude response
	    </item>
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	       <m:math>
		<m:apply>
		  <m:ci type="fn">D</m:ci>
		  <m:ci>ω</m:ci>
		</m:apply>
	      </m:math>  : the ideal amplitude response
	    </item>
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      <m:math>
		<m:apply>
		  <m:ci type="fn">W</m:ci>
		  <m:ci>ω</m:ci>
		</m:apply>
	      </m:math>  : nonnegative weighting function
	    </item>
	  </list>
	</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="deriv2">
	  The weighting function can be used to assign more importance
	  to specific parts of the frequency response. For example, it
	  is common to weight the stop-band more heavily than the
	  pass-band. Once the length <m:math><m:ci>N</m:ci></m:math>
	  and the Type of the filter (I, II, III, IV) is chosen, the
	  goal is to find the filter coefficients
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">h</m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	  </m:math> that minimizes 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>ε</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>. To develop this approach, we will consider the
	  design of Type I FIR filters. The design of the other 3
	  linear-phase FIR filter types can be developed
	  similarly.
	</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="deriv3">
	  Recall that for a Type I FIR filter, the amplitude response
	  if given by
	  
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">A</m:ci>
		<m:ci>ω</m:ci>
	      </m:apply>
	      <m:apply>
		<m:sum/>
		<m:bvar>
		  <m:ci>n</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 type="fn">a</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:cos/>
		    <m:apply>
		      <m:times/>
		      <m:ci>n</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  where 

	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">a</m:ci>
		<m:cn>0</m:cn>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">h</m:ci>
		<m:ci>M</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">a</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	      <m:apply>
		<m:times/>
		<m:cn>2</m:cn>
		<m:apply>
		  <m:ci type="fn">h</m:ci>
		  <m:apply>
		    <m:minus/>
		    <m:ci>M</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>

	  <m:math display="block">
	    <m:apply>
	      <m:leq/>
	      <m:cn>1</m:cn>
	      <m:ci>n</m:ci>
	      <m:ci>M</m:ci>
	    </m:apply>
	  </m:math>

	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:ci>M</m:ci>
	      <m:apply>
		<m:divide/>
		<m:apply>
		  <m:minus/>
		  <m:ci>N</m:ci>
		  <m:cn>1</m:cn>
		</m:apply>
		<m:cn>2</m:cn>
	      </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="derivpara3">
	  To obtain the coefficients
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">a</m:ci>
	      <m:ci>n</m:ci>
	    </m:apply>
	  </m:math> to minimize 
	   <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>ε</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>, we can set the derivatives equal to zero,
	  
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:diff/>
		<m:bvar>
		  <m:apply>
		    <m:ci type="fn">a</m:ci>
		    <m:ci>k</m:ci>
		  </m:apply>
		</m:bvar>
		<m:ci>
		  <m:msub>
		    <m:mi>ε</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
	      </m:apply>
	      <m:cn>0</m:cn>
	    </m:apply>
	  </m:math>

	  <m:math display="block">
	    <m:apply>
	      <m:leq/>
	      <m:cn>0</m:cn>
	      <m:ci>k</m:ci>
	      <m:ci>M</m:ci>
	    </m:apply>
	  </m:math> 
	  The derivatives of 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>ε</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math> with respect to
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">a</m:ci>
	      <m:ci>k</m:ci>
	    </m:apply>
	  </m:math> can be found as:

	  <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="deriv4">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:diff/>
		  <m:bvar>
		    <m:apply>
		      <m:ci type="fn">a</m:ci>
		      <m:ci>k</m:ci>
		    </m:apply>
		  </m:bvar>
		  <m:ci>
		    <m:msub>
		      <m:mi>ε</m:mi>
		      <m:mn>2</m:mn>
		    </m:msub>
		  </m:ci>
		</m:apply>
		<m:apply>
		  <m:int/>
		  <m:bvar>
		    <m:ci>ω</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:pi/>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:diff/>
		      <m:bvar>
			<m:apply>
			  <m:ci type="fn">a</m:ci>
			  <m:ci>k</m:ci>
			</m:apply>
		      </m:bvar>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci type="fn">W</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:power/>
			  <m:apply>
			    <m:minus/>
			    <m:apply>
			      <m:ci type="fn">A</m:ci>
			      <m:ci>ω</m:ci>
			    </m:apply>
			    <m:apply>
			      <m:ci type="fn">D</m:ci>
			      <m:ci>ω</m:ci>
			    </m:apply>
			  </m:apply>
			  <m:cn>2</m:cn>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:cn>2</m:cn>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:ci type="fn">A</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:ci type="fn">D</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:diff/>
			<m:bvar>
			  <m:apply>
			    <m:ci type="fn">a</m:ci>
			    <m:ci>k</m:ci>
			  </m:apply>
			</m:bvar>
			<m:apply>
			  <m:ci type="fn">A</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:cn>2</m:cn>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:ci type="fn">A</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:ci type="fn">D</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			    <m:ci>k</m:ci>
			    <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  Therefore, 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:diff/>
		<m:bvar>
		  <m:apply>
		    <m:ci type="fn">a</m:ci>
		    <m:ci>k</m:ci>
		  </m:apply>
		</m:bvar>
		<m:ci>
		  <m:msub>
		    <m:mi>ε</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
	      </m:apply>
	      <m:cn>0</m:cn>
	    </m:apply>
	  </m:math> 
	  becomes
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
		<m:apply>
		  <m:int/>
		  <m:bvar>
		    <m:ci>ω</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:pi/>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">W</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">A</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:cos/>
		      <m:apply>
			<m:times/>
			<m:ci>k</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:int/>
		  <m:bvar>
		    <m:ci>ω</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:pi/>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">W</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">D</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:cos/>
		      <m:apply>
			<m:times/>
			<m:ci>k</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	    </m:apply>
	  </m:math>
	  or
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>ω</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:pi/>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn">W</m:ci>
		    <m:ci>ω</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:sum/>
		    <m:bvar>
		      <m:ci>n</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:cn>M</m:cn>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">a</m:ci>
			<m:ci>n</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>n</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:cos/>
		    <m:apply>
		      <m:times/>
		      <m:ci>k</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:int/>
		<m:bvar>
		  <m:ci>ω</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>0</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:pi/>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:ci type="fn">W</m:ci>
		    <m:ci>ω</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:ci type="fn">D</m:ci>
		    <m:ci>ω</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:cos/>
		    <m:apply>
		      <m:times/>
		      <m:ci>k</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  or
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>n</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:cn>M</m:cn>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">a</m:ci>
		      <m:ci>n</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:int/>
		      <m:bvar>
			<m:ci>ω</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>0</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:pi/>
		      </m:uplimit>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci type="fn">W</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:cos/>
			  <m:apply>
			    <m:times/>
			    <m:ci>n</m:ci>
			    <m:ci>ω</m:ci>
			  </m:apply>
			</m:apply>
			<m:apply>
			  <m:cos/>
			  <m:apply>
			    <m:times/>
			    <m:ci>k</m:ci>
			    <m:ci>ω</m:ci>
			  </m:apply>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:int/>
		  <m:bvar>
		    <m:ci>ω</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:pi/>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">W</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">D</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:cos/>
		      <m:apply>
			<m:times/>
			<m:ci>k</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	    </m:apply>
	  </m:math>
	  If we define
	  <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="deriveq5">
	    <m:math>
	      <m:apply>
		<m:eq/>
		  <m:apply>
		    <m:ci type="fn">Q</m:ci>
		    <m:ci>k</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		      <m:apply>
			<m:divide/>
			<m:cn>1</m:cn>
			<m:pi/>
		      </m:apply>
		      <m:apply>
			<m:int/>
			<m:bvar>
			  <m:ci>ω</m:ci>
			</m:bvar>
			<m:lowlimit>
			  <m:cn>0</m:cn>
			</m:lowlimit>
			<m:uplimit>
			  <m:pi/>
			</m:uplimit>
			<m:apply>
			  <m:times/>
			  <m:apply>
			    <m:ci type="fn">W</m:ci>
			    <m:ci>ω</m:ci>
			  </m:apply>
			  <m:apply>
			    <m:cos/>
			    <m:apply>
			      <m:times/>
			      <m:ci>n</m:ci>
			      <m:ci>ω</m:ci>
			    </m:apply>
			  </m:apply>
			  <m:apply>
			    <m:cos/>
			    <m:apply>
			      <m:times/>
			      <m:ci>k</m:ci>
			      <m:ci>ω</m:ci>
			    </m:apply>
			  </m:apply>
			</m:apply>
		      </m:apply>
		  </m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  and 
	  <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="deriveq6">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">b</m:ci>
		  <m:ci>k</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:ci type="fn">D</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>k</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  then the derivative conditions can be written as
	  <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="deriveq7">
	    <m:math display="block">
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:sum/>
		  <m:bvar>
		    <m:ci>n</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:cn>0</m:cn>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:cn>M</m:cn>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:ci>k</m:ci>
		      <m:ci>n</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">a</m:ci>
		      <m:ci>n</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:ci type="fn">b</m:ci>
		  <m:ci>k</m:ci>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  where 
	  <m:math display="block">
	    <m:apply>
	      <m:leq/>
		<m:cn>0</m:cn>
		<m:ci>k</m:ci>
		<m:ci>M</m:ci>
	    </m:apply>
	  </m:math>
	  This is a linear system of equations, and can be written in
	  matrix form as
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:times/>
		<m:matrix>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:cn>0</m:cn>
		      <m:cn>0</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:cn>0</m:cn>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:cn>0</m:cn>
		      <m:ci>M</m:ci>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:cn>1</m:cn>
		      <m:cn>0</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:cn>1</m:cn>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:cn>1</m:cn>
		      <m:ci>M</m:ci>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:ci>M</m:ci>
		      <m:cn>0</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:ci>M</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">Q</m:ci>
		      <m:ci>M</m:ci>
		      <m:ci>M</m:ci>
		    </m:apply>
		  </m:matrixrow>
		</m:matrix>
		<m:matrix>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">a</m:ci>
		      <m:cn>0</m:cn>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">a</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:ci>⋮</m:ci>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">a</m:ci>
		      <m:ci>M</m:ci>
		    </m:apply>
		  </m:matrixrow>
		</m:matrix>
	      </m:apply>
	      <m:matrix>
		<m:matrixrow>
		  <m:apply>
		    <m:ci type="fn">b</m:ci>
		    <m:cn>0</m:cn>
		  </m:apply>
		</m:matrixrow>
		<m:matrixrow>
		  <m:apply>
		    <m:ci type="fn">b</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		</m:matrixrow>
		<m:matrixrow>
		  <m:ci>⋮</m:ci>
		</m:matrixrow>
		<m:matrixrow>
		  <m:apply>
		    <m:ci type="fn">b</m:ci>
		    <m:ci>M</m:ci>
		  </m:apply>
		</m:matrixrow>
	      </m:matrix>
	    </m:apply>
	  </m:math>
	  or

	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:times/>
		<m:ci>Q</m:ci>
		<m:ci>a</m:ci>
	      </m:apply>
	      <m:ci>b</m:ci>
	    </m:apply>
	  </m:math>
	  Therefore, the Type 1 FIR filter that minimizes the square error
	  can be obtained by solving this linear system of equations.
	  
	  <m:math display="block">
	    <m:apply>
	      <m:eq/>
	      <m:ci>a</m:ci>
	      <m:apply>
		<m:times/>
		<m:apply>
		  <m:inverse/>
		    <m:ci>Q</m:ci>
		</m:apply>
		<m:ci>b</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>
	</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="structQ">
	<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/">Structure of the Matrix Q</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="struct1">
	  It turns out that the matrix <m:math><m:ci>Q</m:ci></m:math>
	  has a special structure. Note that

	  <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="structeq8">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:cos/>
		    <m:apply>
		      <m:times/>
		      <m:ci>n</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:cos/>
		    <m:apply>
		      <m:times/>
		      <m:ci>k</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:cos/>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:minus/>
			  <m:ci>k</m:ci>
			  <m:ci>n</m:ci>
			</m:apply>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </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:cos/>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:plus/>
			  <m:ci>k</m:ci>
			  <m:ci>n</m:ci>
			</m:apply>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  so that

	  <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="structeq9">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">Q</m:ci>
		  <m:ci>k</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>n</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>k</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:pi/>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:int/>
		      <m:bvar>
			<m:ci>ω</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>0</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:pi/>
		      </m:uplimit>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci type="fn">W</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:cos/>
			  <m:apply>
			    <m:times/>
			    <m:apply>
			      <m:minus/>
			      <m:ci>k</m:ci>
			      <m:ci>n</m:ci>
			    </m:apply>
			    <m:ci>ω</m:ci>
			  </m:apply>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:pi/>
		      </m:apply>
		    </m:apply>
		    <m:apply>
		      <m:int/>
		      <m:bvar>
			<m:ci>ω</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>0</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:pi/>
		      </m:uplimit>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci type="fn">W</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:cos/>
			  <m:apply>
			    <m:times/>
			    <m:apply>
			      <m:plus/>
			      <m:ci>k</m:ci>
			      <m:ci>n</m:ci>
			    </m:apply>
			    <m:ci>ω</m:ci>
			  </m:apply>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>		
	  or
	  
	  <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="structeq11">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">Q</m:ci>
		  <m:ci>k</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">
			<m:msub>
			  <m:mi>Q</m:mi>
			  <m:mn>1</m:mn>
			</m:msub>
		      </m:ci>
		      <m:ci>k</m:ci>
		      <m:ci>n</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:ci type="fn">
			<m:msub>
			  <m:mi>Q</m:mi>
			  <m:mn>2</m:mn>
			</m:msub>
		      </m:ci>
		      <m:ci>k</m:ci>
		      <m:ci>n</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  where 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>Q</m:mi>
		<m:mn>1</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	  and
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>Q</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	  are defined as

	  <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="structeq12">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>Q</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>k</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:apply>
			    <m:minus/>
			    <m:ci>k</m:ci>
			    <m:ci>n</m:ci>
			  </m:apply>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  and
	  
	  <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="structeq13">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>Q</m:mi>
		      <m:mn>2</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>k</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:apply>
			    <m:plus/>
			    <m:ci>k</m:ci>
			    <m:ci>n</m:ci>
			  </m:apply>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  
	  Accordingly, we can write
	  
	  <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="structeq14a">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>Q</m:mi>
		      <m:mn>1</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>k</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:apply>
		    <m:minus/>
		    <m:ci>k</m:ci>
		    <m:ci>n</m:ci>
		  </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="structeq14b">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">
		    <m:msub>
		      <m:mi>Q</m:mi>
		      <m:mn>2</m:mn>
		    </m:msub>
		  </m:ci>
		  <m:ci>k</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:apply>
		    <m:plus/>
		    <m:ci>k</m:ci>
		    <m:ci>n</m:ci>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  
	  where
	  
	  <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="structeq15">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>n</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  With this notation, the matrices 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>Q</m:mi>
		<m:mn>1</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	  and
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>Q</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	  are written as

	  <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="structeq16">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:ci>
		  <m:msub>
		    <m:mi>Q</m:mi>
		    <m:mn>1</m:mn>
		  </m:msub>
		</m:ci>
		<m:matrix>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>0</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:ci>M</m:ci>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>0</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>M</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:ci>M</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:apply>
			<m:minus/>
			<m:ci>M</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>0</m:cn>
		    </m:apply>
		  </m:matrixrow>
		</m:matrix>
	      </m:apply>
	    </m:math>
	  </equation>

	  and
		
	  <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="structeq17">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:ci>
		  <m:msub>
		    <m:mi>Q</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
		<m:matrix>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>0</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:ci>M</m:ci>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>1</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:cn>2</m:cn>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:apply>
			<m:plus/>
			<m:ci>M</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		    <m:ci>⋮</m:ci>
		  </m:matrixrow>
		  <m:matrixrow>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:ci>M</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:apply>
			<m:plus/>
			<m:ci>M</m:ci>
			<m:cn>1</m:cn>
		      </m:apply>
		    </m:apply>
		    <m:ci>…</m:ci>
		    <m:apply>
		      <m:ci type="fn">q</m:ci>
		      <m:apply>
			<m:times/>
			<m:cn>2</m:cn>
			<m:ci>M</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:matrixrow>
		</m:matrix>
	      </m:apply>
	    </m:math>
	  </equation>

	  Note that we have used 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">q</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>n</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">q</m:ci>
		<m:ci>n</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  here. The matrix 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>Q</m:mi>
		<m:mn>1</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	  is a symmetric Toeplitz matrix (constant along its
	  diagonals), and the matrix 
	  <m:math>
	    <m:ci>
	      <m:msub>
		<m:mi>Q</m:mi>
		<m:mn>2</m:mn>
	      </m:msub>
	    </m:ci>
	  </m:math>
	  is a Hankel matrix (constant along its anti-diagonals).
	  Consequently,
	  
	  <list 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="struct" type="enumerated">
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">the matrices can be stored with less memory than
	      arbitrary matrices (
	      <m:math>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:times/>
		    <m:cn>2</m:cn>
		    <m:ci>M</m:ci>
		  </m:apply>
		  <m:cn>1</m:cn>
		</m:apply>
	      </m:math>
	      
	      numbers instead of 
	      <m:math>
		<m:apply>
		  <m:power/>
		  <m:apply>
		    <m:plus/>
		    <m:ci>M</m:ci>
		    <m:cn>1</m:cn>
		  </m:apply>
		  <m:cn>2</m:cn>
		</m:apply>
	      </m:math>

	      numbers),
	    </item>
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/"> there are fast algorithms to compute the solution to
	    'Toeplitz plus Hankel' systems with computational
	    complexity 
	      
	      <m:math>
		<m:apply>
		  <m:ci type="fn">O</m:ci>
		  <m:apply>
		    <m:power/>
		    <m:ci>M</m:ci>
		    <m:cn>2</m:cn>
		  </m:apply>
		</m:apply>
	      </m:math>
	      instead of 

	      <m:math>
		<m:apply>
		  <m:ci type="fn">O</m:ci>
		  <m:apply>
		    <m:power/>
		    <m:ci>M</m:ci>
		    <m:cn>3</m:cn>
		  </m:apply>
		</m:apply>
	      </m:math>.
	      (In fact, the complexity can be reduced further, but
	      with higher overhead.)
	    </item>
	  </list>
	</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="RelatDTFT">
	<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/">Relation to the DTFT</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="relation">To express
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">q</m:ci>
	      <m:ci>k</m:ci>
	    </m:apply>
	  </m:math>
	  and 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">b</m:ci>
	      <m:ci>k</m:ci>
	    </m:apply>
	  </m:math>
	  using the inverse Fourier transform, extend 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">D</m:ci>
	      <m:ci>ω</m:ci>
	    </m:apply>
	  </m:math>
	  and
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">W</m:ci>
	      <m:ci>ω</m:ci>
	    </m:apply>
	  </m:math>
	  symmetrically, so that
	  
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">D</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>ω</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">D</m:ci>
		<m:ci>ω</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  
	  and 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:apply>
		<m:ci type="fn">W</m:ci>
		<m:apply>
		  <m:minus/>
		  <m:ci>ω</m:ci>
		</m:apply>
	      </m:apply>
	      <m:apply>
		<m:ci type="fn">W</m:ci>
		<m:ci>ω</m:ci>
	      </m:apply>
	    </m:apply>
	  </m:math>.  Then we can write
	  
	  <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="relateq18">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:apply>
			<m:minus/>
			<m:pi/>
		      </m:apply>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>n</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  As sine is an anti-symmetric function
	 <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="relateq19">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:int/>
		  <m:bvar>
		    <m:ci>ω</m:ci>
		  </m:bvar>
		  <m:lowlimit>
		    <m:apply>
		      <m:minus/>
		      <m:pi/>
		    </m:apply>
		  </m:lowlimit>
		  <m:uplimit>
		    <m:pi/>
		  </m:uplimit>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:ci type="fn">W</m:ci>
		      <m:ci>ω</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:sin/>
		      <m:apply>
			<m:times/>
			<m:ci>n</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:cn>0</m:cn>
	      </m:apply>
	    </m:math>
	  </equation>
	  
	  so we can write 
	  <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="relateq20">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:apply>
			<m:minus/>
			<m:pi/>
		      </m:apply>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:plus/>
			<m:apply>
			  <m:cos/>
			  <m:apply>
			    <m:times/>
			    <m:ci>n</m:ci>
			    <m:ci>ω</m:ci>
			  </m:apply>
			</m:apply>			
			<m:apply>			  
			  <m:times/>			  
			  <m:imaginaryi/>
			  <m:apply>
			    <m:sin/>
			    <m:apply>
			      <m:times/>
			      <m:ci>n</m:ci>
			      <m:ci>ω</m:ci>
			    </m:apply>
			  </m:apply>
			</m:apply>			    
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	   
	  or
	  <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="relateq21">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:apply>
		      <m:times/>
		      <m:cn>2</m:cn>
		      <m:pi/>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:apply>
			<m:minus/>
			<m:pi/>
		      </m:apply>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:exp/>
			<m:apply>
			  <m:times/>			  
			  <m:imaginaryi/>
			  <m:ci>n</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  which we recognize as the inverse discrete-time Fourier
	  transform 
	  
	  <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="relateq22">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:inverse/>
		    <m:ci>DTFT</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:vector>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:vector>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  Similarly,

	  <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="relateq23">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>n</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:inverse/>
		    <m:ci>DTFT</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:vector>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:ci type="fn">W</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:apply>
			  <m:ci type="fn">D</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:vector>
		  </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="lpwse">
	<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/">Low-Pass: Weighted Square Error</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="lpwsepara">
	  The weighting function 
	  <m:math>
	    <m:apply>
	      <m:ci type="fn">W</m:ci>
	      <m:ci>ω</m:ci>
	    </m:apply>
	  </m:math>
	  can be used to improve the FIR low-pass filter because
	  
	  <list 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="lowpass" type="enumerated">
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      it allows you to eliminate Gibbs phenomenon by deleting
	      a neighborhood around the band edge, and
	    </item>
	    <item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">
	      it allows you to assign different weights to the
	      pass-band and the stop-band.
	    </item>
	  </list>

	  For example, if the ideal low-pass amplitude response is as
	  shown 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="lowpass1" strength="9"/>.
	</para>

	<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="lowpass1">
          <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="lowpass1.png"/>
	</figure>

	<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="lpwse2">
	  and if the weighting function is as shown, <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="lowpass2" strength="9"/>.
	</para>

	<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="lowpass2"> 
          <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="lowpass2.png"/>
	 </figure>

	<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="lpwse3">
	  where 
	  <m:math>
	    <m:apply>
	      <m:lt/>
	      <m:ci>
		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mi>p</m:mi>
		</m:msub>
	      </m:ci>
	      <m:ci>
		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mi>o</m:mi>
		</m:msub>
	      </m:ci>
	      <m:ci>
		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mi>s</m:mi>
		</m:msub>
	      </m:ci>
	    </m:apply>
	  </m:math>,
	  then the square error criterion becomes
		  
	  <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="lpwse24">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:ci>
		  <m:msub>
		    <m:mi>ε</m:mi>
		    <m:mn>2</m:mn>
		  </m:msub>
		</m:ci>
		<m:apply>
		  <m:plus/>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>
			<m:msub>
			  <m:mi>ω</m:mi>
			  <m:mi>p</m:mi>
			</m:msub>
		      </m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:power/>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:ci type="fn">A</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:cn>1</m:cn>
		      </m:apply>
		      <m:cn>2</m:cn>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:ci>K</m:ci>
		    <m:apply>
		      <m:int/>
		      <m:bvar>
			<m:ci>ω</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:ci>
			  <m:msub>
			    <m:mi>ω</m:mi>
			    <m:mi>s</m:mi>
			  </m:msub>
			</m:ci>
		      </m:lowlimit>
		      <m:uplimit>
			<m:pi/>
		      </m:uplimit>
		      <m:apply>
			<m:power/>
			<m:apply>
			  <m:ci type="fn">A</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
			<m:cn>2</m:cn>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  To find the matrix <m:math><m:ci>Q</m:ci></m:math> and the
	  vector <m:math><m:ci>b</m:ci></m:math> to this weighting
	  function it is useful to recall
	  
	  <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="lpwse25">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:ci>
			<m:msub>
			  <m:mi>ω</m:mi>
			  <m:mn>1</m:mn>
			</m:msub>
		      </m:ci>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>
			<m:msub>
			  <m:mi>ω</m:mi>
			  <m:mn>2</m:mn>
			</m:msub>
		      </m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:cos/>
		      <m:apply>
			<m:times/>
			<m:ci>n</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:minus/>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:ci>
			<m:msub>
			  <m:mi>ω</m:mi>
			  <m:mn>2</m:mn>
			</m:msub>
		      </m:ci>
		      <m:pi/>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">sinc</m:ci>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:divide/>
			  <m:ci>
			    <m:msub>
			      <m:mi>ω</m:mi>
			      <m:mn>2</m:mn>
			    </m:msub>
			  </m:ci>
			  <m:pi/>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:ci>
			<m:msub>
			  <m:mi>ω</m:mi>
			  <m:mn>1</m:mn>
			</m:msub>
		      </m:ci>
		      <m:pi/>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">sinc</m:ci>
		      <m:apply>
			<m:times/>
			<m:apply>
			  <m:divide/>
			  <m:ci>
			    <m:msub>
			      <m:mi>ω</m:mi>
			      <m:mn>1</m:mn>
			    </m:msub>
			  </m:ci>
			  <m:pi/>
			</m:apply>
			<m:ci>n</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>
	  
	  Then
	  <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="lpwse26">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">q</m:ci>
		  <m:ci>k</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>			    
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>k</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>  <!-- lpwse equation 27 -->
		  <m:plus/>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:cn>1</m:cn>
		      <m:pi/>
		    </m:apply>
		    <m:apply>
		      <m:int/>
		      <m:bvar>
			<m:ci>ω</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:cn>0</m:cn>
		      </m:lowlimit>
		      <m:uplimit>
			<m:ci>
			  <m:msub>
			    <m:mi>ω</m:mi>
			    <m:mi>p</m:mi>
			  </m:msub>
			</m:ci>
		      </m:uplimit>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>k</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		  <m:apply>
		    <m:times/>
		    <m:apply>
		      <m:divide/>
		      <m:ci>K</m:ci>
		      <m:pi/>
		    </m:apply>
		    <m:apply>
		      <m:int/>
		      <m:bvar>
			<m:ci>ω</m:ci>
		      </m:bvar>
		      <m:lowlimit>
			<m:ci>
			  <m:msub>
			    <m:mi>ω</m:mi>
			    <m:mi>s</m:mi>
			  </m:msub>
			</m:ci>
		      </m:lowlimit>
		      <m:uplimit>
			<m:pi/>
		      </m:uplimit>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>k</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply> <!-- lpwse equation 28 -->
		  <m:piecewise>
		    <m:piece>
		      <m:apply>
			<m:plus/>
			<m:apply>
			  <m:divide/>
			  <m:ci>
			    <m:msub>
			      <m:mi>ω</m:mi>
			      <m:mi>p</m:mi>
			    </m:msub>
			  </m:ci>
			  <m:pi/>
			</m:apply>
			<m:apply>
			  <m:times/>
			  <m:ci>K</m:ci>
			  <m:apply>
			    <m:minus/>
			    <m:cn>1</m:cn>
			    <m:apply>
			      <m:divide/>
			      <m:ci>
				<m:msub>
				  <m:mi>ω</m:mi>
				  <m:mi>s</m:mi>
				</m:msub>
			      </m:ci>
			      <m:pi/>
			    </m:apply>
			  </m:apply>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:eq/>
			<m:ci>k</m:ci>
			<m:cn>0</m:cn>
		      </m:apply>
		    </m:piece>
		    <m:piece>
		      <m:apply>
			<m:minus/>
			<m:apply>
			  <m:times/>
			  <m:apply>
			    <m:divide/>
			    <m:ci>
			      <m:msub>
				<m:mi>ω</m:mi>
				<m:mi>p</m:mi>
			      </m:msub>
			    </m:ci>
			    <m:pi/>
			  </m:apply>
			  <m:apply>
			    <m:ci type="fn">sinc</m:ci>
			    <m:apply>
			      <m:times/>
			      <m:apply>
				<m:divide/>
				<m:ci>
				  <m:msub>
				    <m:mi>ω</m:mi>
				    <m:mi>p</m:mi>
				  </m:msub>
				</m:ci>
				<m:pi/>
			      </m:apply>
			      <m:ci>k</m:ci>
			    </m:apply>
			  </m:apply>
			</m:apply>
			<m:apply>
			  <m:times/>
			  <m:ci>K</m:ci>
			  <m:apply>
			    <m:divide/>
			    <m:ci>
			      <m:msub>
				<m:mi>ω</m:mi>
				<m:mi>s</m:mi>
			      </m:msub>
			    </m:ci>
			    <m:pi/>
			  </m:apply>
			  <m:apply>
			    <m:ci type="fn">sinc</m:ci>
			    <m:apply>
			      <m:times/>
			      <m:apply>
				<m:divide/>
				<m:ci>
				  <m:msub>
				    <m:mi>ω</m:mi>
				    <m:mi>s</m:mi>
				  </m:msub>
				</m:ci>
				<m:pi/>
			      </m:apply>
			      <m:ci>k</m:ci>
			    </m:apply>
			  </m:apply>
			</m:apply>
		      </m:apply>
		      <m:apply>
			<m:neq/>
			<m:ci>k</m:ci>
			<m:cn>0</m:cn>
		      </m:apply>		      
		    </m:piece>
		  </m:piecewise>
		</m:apply>
	      </m:apply>
	    </m:math>
	  </equation>

	  Similarly,
	  
	  <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="lpwse29">
	    <m:math>
	      <m:apply>
		<m:eq/>
		<m:apply>
		  <m:ci type="fn">b</m:ci>
		  <m:ci>k</m:ci>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:pi/>
		    </m:uplimit>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:ci type="fn">W</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>	
		      <m:apply>
			<m:ci type="fn">D</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		      <m:apply>
			<m:cos/>
			<m:apply>
			  <m:times/>
			  <m:ci>k</m:ci>
			  <m:ci>ω</m:ci>
			</m:apply>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply> <!-- lpwse equation 30 -->
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:cn>1</m:cn>
		    <m:pi/>
		  </m:apply>
		  <m:apply>
		    <m:int/>
		    <m:bvar>
		      <m:ci>ω</m:ci>
		    </m:bvar>
		    <m:lowlimit>
		      <m:cn>0</m:cn>
		    </m:lowlimit>
		    <m:uplimit>
		      <m:ci>
			<m:msub>
			  <m:mi>ω</m:mi>
			  <m:mi>p</m:mi>
			</m:msub>
		      </m:ci>
		    </m:uplimit>
		    <m:apply>
		      <m:cos/>
		      <m:apply>
			<m:times/>
			<m:ci>k</m:ci>
			<m:ci>ω</m:ci>
		      </m:apply>
		    </m:apply>
		  </m:apply>
		</m:apply>
		<m:apply>
		  <m:times/>
		  <m:apply>
		    <m:divide/>
		    <m:ci>
		      <m:msub>
			<m:mi>ω</m:mi>
			<m:mi>p</m:mi>
		      </m:msub>
		    </m:ci>
		    <m:pi/>
		  </m:apply>
		  <m:apply> <!-- lpwse equation 31 -->
		    <m:ci type="fn">sinc</m:ci>
		    <m:apply>
		      <m:times/>
		      <m:apply>
			<m:divide/>
			<m:ci>
			  <m:msub>
			    <m:mi>ω</m:mi>
			    <m:mi>p</m:mi>
			  </m:msub>
			</m:ci>
			<m:pi/>
		      </m:apply>
		      <m:ci>k</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="lpex">
	<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/">Weighted Low-Pass Example</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="lpex1">
	  In the following example, we design a Type 1 FIR
	  low-pass filter of length 31, with band-edges 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>
		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mi>p</m:mi>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:times/>
		<m:cn>0.26</m:cn>
		<m:pi/>
	      </m:apply>
	    </m:apply>
	  </m:math>,
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>
		<m:msub>
		  <m:mi>ω</m:mi>
		  <m:mi>s</m:mi>
		</m:msub>
	      </m:ci>
	      <m:apply>
		<m:times/>
		<m:cn>0.34</m:cn>
		<m:pi/>
	      </m:apply>
	    </m:apply>
	  </m:math>
	  and a stop-band weight of 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>K</m:ci>
	      <m:cn>10</m:cn>
	    </m:apply>
	  </m:math>.  (See <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="matlab1" strength="9"/>)
	</para>
	
	<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="matlab1">
	  <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="wated.png"/>
	  <caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">The second figure shows the pass-band edge
	  detail. </caption>
	</figure> 
	  
	<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="lpex2">
	  Compared to the <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/">Impulse Response Truncation
	  </emphasis> (IRT) method the peak error is reduced.
	  The filter was designed using the following Matlab code.
	</para>

	<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/" type="block" id="matlabcode">
	  <![CDATA[
	  % WEIGHTED LEAST SQUARE LOWPASS FILTER
	  
	  % filter length
	  N = 31;  
	  M = (N-1)/2;
	  
	  % set band-edges and stop-band weighting
	  wp = 0.26*pi;
	  ws = 0.34*pi;
	  K = 10;

	  % normalize band-edges for convenience
	  fp = wp/pi;
	  fs = ws/pi;

	  % construct q(k)
	  q  = [fp+K*(1-fs), fp*sinc(fp*[1:2*M])-K*fs*sinc(fs*[1:2*M])];

	  
	  % construct Q1, Q2, Q
	  Q1 = toeplitz(q([0:M]+1));
	  Q2 = hankel(q([0:M]+1),q([M:2*M]+1));
	  Q  = (Q1 + Q2)/2;

	  % construct b
	  b  = fp*sinc(fp*[0:M]');

	  % solve linear system to get a(n)
	  a  = Q\b;

	  % form impulse response h(n)
	  h  = [a(M+1:-1:2)/2; a(1); a(2:M+1)/2];
	  ]]>
	</code>
      </section>

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