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
|
<?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>Calling Sequence</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>
</refentry>
|