<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from lpc.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="lpc" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>lpc</refname>
    <refpurpose>Linear prediction filter coefficients</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   [a,g] = lpc(x)
   [a,g] = lpc(x,p)
   
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Description</title>
   <para>
[a,g] = lpc(x,p)
Determines the coefficients of a pth order forward linear predictor
filter by minimizing the squared error. If p is unspecified, a
default value of length(x)-1 is used.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>x:</term>
            <listitem><para> double</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>p:</term>
            <listitem><para> int, natural number, scalar</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>a:</term>
            <listitem><para> double</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>g:</term>
            <listitem><para> double</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
noise = rand(50000,1,"normal");
x = filter(1,[1 1/2 1/3 1/4],noise);
x = x(45904:50000);
[a,g]= lpc(x,3)
est_x = filter([0 -a(2:$)],1,x);
e = x-est_x;
[acs,lags] = xcorr(e,'coeff');
plot(1:97,x(4001:4097),1:97,est_x(4001:4097),'--');
a = gca();
a.grid = [1,1];
title('Original Signal vs. LPC Estimate');
xlabel ('Sample number', ylabel 'Amplitude');
legend('Original signal','LPC estimate');

   ]]></programlisting>
</refsection>

<refsection>
   <title>Bibliography</title>
   <para>[1] Hayes, Monson H. Statistical digital signal processing and modeling.</para>
   <para>John Wiley &amp; Sons, 2009, pg. 220</para>
</refsection>

<refsection role="see also">
   <title>See also</title>
   <simplelist type="inline">
   <member><link linkend="aryule">| levinson | prony | pyulear | stmcb</link></member>
   </simplelist>
</refsection>

<refsection>
   <title>Authors</title>
   <simplelist type="vert">
   <member>Ayush Baid</member>
   </simplelist>
</refsection>
</refentry>
