summaryrefslogtreecommitdiff
path: root/help/en_US/lpc.xml
blob: 079923e1f53aad6c35c15cc943d1adf2db6139a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?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>
    <para> </para>
  </refnamediv>


<refsynopsisdiv>
   <title>Calling Sequence</title>
   <synopsis>
   [a,g] = lpc(x)
   [a,g] = lpc(x,p)
   </synopsis>
    <para> </para>
</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. <para>If p is unspecified, a
default value of length(x)-1 is used.</para>
   </para>
   <para> </para>
</refsection>

<refsection>
   <title>Parameters</title>
   <variablelist>
   <varlistentry><term>x:</term>
      <listitem><para> double</para><para>input signal, if it is a matrix each column is computed independently</para></listitem></varlistentry>
   <varlistentry><term>p:</term>
      <listitem><para> int, natural number, scalar</para><para>order of linear predictor filter, value must be scalar, positive and must be less than or equal to length of input signal </para></listitem></varlistentry>
   <varlistentry><term>a:</term>
      <listitem><para> double</para><para>coefficient of forward linear predictor, coefficient for each signal input is returned as a row vector</para></listitem></varlistentry>
   <varlistentry><term>g:</term>
      <listitem><para> double</para><para>Column vector of averaged square prediction error</para></listitem></varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para> This function determines coefficients of a forward linear predictor by minimizing prediction error in least squares sense. It is used in Digital Filter Design </para>
    <para> </para>
</refsection>

<refsection>
   <title>Examples</title>

   <programlisting role="example"><![CDATA[
noise = rand(50000,1,"normal"); //Gaussian White Noise
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>

 <scilab:image>
noise = rand(50000,1,"normal"); //Gaussian White Noise
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');
        </scilab:image>
   <para> </para>

</refsection>


<refsection>
   <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>