<?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="m10824">
  <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/">Speech Processing: LPC Exercise in MATLAB</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/08/20</md:created>
  <md:revised xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">2003/08/01 11:48:40.661 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="appadwed">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Swaroop</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Appadwedula</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">appadwed@uiuc.edu</md:email>
    </md:author>
    <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:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="kramer">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Michael</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/">Kramer</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">kramer@ifp.uiuc.edu</md:email>
    </md:author>
    <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="moussa">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Dima</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Moussa</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">dmoussa@uiuc.edu</md:email>
    </md:author>
    <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="bwade">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Brian</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Wade</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">bwade@uiuc.edu</md:email>
    </md:author>
    <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="jake">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Jake</md:firstname>
      
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Janevitz</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">jake@janevitz.com</md:email>
    </md:author>
    <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="dsachs">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Daniel</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Grobe</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Sachs</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">sachs@uiuc.edu</md:email>
    </md:author>
    <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="mjberry">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Matthew</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">J.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Berry</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mjberry@uiuc.edu</md:email>
    </md:author>
    <md:author xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="markhaun">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Mark</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">A.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Haun</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">markhaun@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="mjberry">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Matthew</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">J.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Berry</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">mjberry@uiuc.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="butala">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Mark</md:firstname>
      <md:othername xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">D.</md:othername>
      <md:surname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Butala</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">butala@uiuc.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="rlmorris">
      <md:firstname xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">Robert</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/">Morrison</md:surname>
      <md:email xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">rlmorris@uiuc.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/">linear predictive coding</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">autocorrelation</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">xcorr</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">levinson-durbin algorithm</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">speech</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">speech analysis</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">speech synthesis</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">speech coding</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">speech compression</md:keyword>
    <md:keyword xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">DSP</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/">You will write MATLAB code to compute the autocorrelation sequence of a simple signal.  Then you will implement the Levinson-Durbin algorithm in MATLAB and analyze a recording of your own voice.  </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="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/">MATLAB Exercises</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="prob1">
	First, take a simple signal (<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/">e.g.</foreign>, one
	period of a sinusoid at some frequency) and plot its
	autocorrelation sequence for appropriate values of
	<m:math>
	  <m:ci>l</m:ci>
	</m:math>. You may wish to use the <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/">xcorr</code> MATLAB
	function to compare with your own version of this function.
	At what time shift 
	<m:math>
	  <m:ci>l</m:ci>
	</m:math> is
	<m:math>
	  <m:apply>
	    <m:ci type="fn" class="discrete">
	      <m:msub>
		<m:mi>r</m:mi>
		<m:mrow>
		  <m:mi>s</m:mi>
		  <m:mi>s</m:mi>
		</m:mrow>
	      </m:msub>
	    </m:ci>
	    <m:ci>l</m:ci>
	  </m:apply>
	</m:math> maximized and why?  Is there any symmetry in
	<m:math>
	  <m:apply>
	    <m:ci type="fn" class="discrete">
	      <m:msub>
		<m:mi>r</m:mi>
		<m:mrow>
		  <m:mi>s</m:mi>
		  <m:mi>s</m:mi>
		</m:mrow>
	      </m:msub>
	    </m:ci>
	    <m:ci>l</m:ci>
	  </m:apply>
	</m:math>?  What does
	<m:math>
	  <m:apply>
	    <m:ci type="fn" class="discrete">
	      <m:msub>
		<m:mi>r</m:mi>
		<m:mrow>
		  <m:mi>s</m:mi>
		  <m:mi>s</m:mi>
		</m:mrow>
	      </m:msub>
	    </m:ci>
	    <m:ci>l</m:ci>
	  </m:apply>
	</m:math> look like for periodic signals?
      </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="prob2">
	Next, write your own version of the Levinson-Durbin algorithm
	in MATLAB.  Note that MATLAB uses indexing from
	<m:math>
	  <m:cn>1</m:cn>
	</m:math> rather than
	<m:math>
	  <m:cn>0</m:cn>
	</m:math>.  One way to resolve this problem is to start the
	loop with
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>i</m:ci>
	    <m:cn>2</m:cn>
	  </m:apply>
	</m:math>, then shift the variables
	<m:math>
	  <m:ci>k</m:ci>
	</m:math>,
	<m:math>
	  <m:ci>E</m:ci>
	</m:math>,
	<m:math>
	  <m:ci>α</m:ci>
	</m:math>, and
	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>r</m:mi>
	      <m:mrow>
		<m:mi>s</m:mi>
		<m:mi>s</m:mi>
	      </m:mrow>
	    </m:msub>
	  </m:ci>
	</m:math> to start at 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>i</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math> and 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>j</m:ci>
	    <m:cn>1</m:cn>
	  </m:apply>
	</m:math>. Be careful with indices such as 
	<m:math>
	  <m:apply>
	    <m:minus/>
	    <m:ci>i</m:ci>
	    <m:ci>j</m:ci>
	  </m:apply>
	</m:math>, since these could 
	still be 
	<m:math>
	  <m:cn>0</m:cn>
	</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="para11">
	Apply your algorithm to a 
	<m:math>
	  <m:cn>20</m:cn>
	</m:math>-
	<m:math>
	  <m:cn>30</m:cn>
	</m:math> ms segment of a speech signal.  Use a microphone to
	record <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/">.wav</code> audio files on the PC using Sound
	Recorder or a similar application.  Typically, a sample rate
	of 
	<m:math>
	  <m:cn>8</m:cn>
	</m:math> kHz is a good choice for voice signals, which are
	approximately bandlimited to 
	<m:math>
	  <m:cn>4</m:cn>
	</m:math>
	kHz.  You will use these audio files to test algorithms in
	MATLAB.  The functions <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/">wavread</code>,
	<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/">wavwrite</code>, <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/">sound</code> will help you read,
	write and play audio files in MATLAB:
	
      </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="para12">
	The output of the algorithm is the prediction coefficients

 	<m:math>
	  <m:ci>
	    <m:msub>
	      <m:mi>a</m:mi>
	      <m:mi>k</m:mi>
	    </m:msub>
	  </m:ci>
	</m:math> (usually about 
	<m:math>
	  <m:apply>
	    <m:eq/>
	    <m:ci>P</m:ci>
	    <m:cn>10</m:cn>
	  </m:apply>
	</m:math> coefficients is sufficient), which represent the
	speech segment containing significantly more samples.  The LPC
	coefficients are thus a compressed representation of the
	original speech segment, and we take advantage of this by
	saving or transmitting the LPC coefficients instead of the
	speech samples.  Compare the coefficients generated by your
	function with those generated by the <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/">levinson</code> or
	<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/">lpc</code> functions available in the MATLAB toolbox.
	Next, plot the frequency response of the IIR model represented
	by the LPC coefficients (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/" document="m10482" target="eq5">Speech Processing: Theory of LPC Analysis and
	Synthesis</cnxn>).  What is the fundamental frequency of the
	speech segment?  Is there any similarity in the prediction
	coefficients for different
	<m:math>
	  <m:cn>20</m:cn>
	</m:math>-
	<m:math>
	  <m:cn>30</m:cn>
	</m:math>
	ms segments of the same vowel sound?  How could the prediction
	coefficients be used for recognition?
      </para>
    </section>
    
  </content>
  
</document>
