File: SPcepXpc.html

package info (click to toggle)
libtsp 3r0-1
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 5,096 kB
  • ctags: 1,798
  • sloc: ansic: 14,464; sh: 1,217; makefile: 182
file content (110 lines) | stat: -rw-r--r-- 3,098 bytes parent folder | download
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
<HTML>
<HEAD>
<TITLE>TSP (libtsp/SP) - SPcepXpc</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>SPcepXpc</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
void SPcepXpc (const float cep[], float pc[], int Np)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Convert cepstral coefficients to predictor coefficients
</DL>
<H4>Description</H4>
This routine calculates the predictor coefficients corresponding to a set of
cepstral coefficients.  Consider the prediction error filter A(z),
<P>
<PRE>
              Np       -k
  A(z) = 1 - SUM p(k) z  .
             k=1
</PRE>
<P>
The power spectrum corresponding to the all-pole LPC filter is
<P>
<PRE>
  S(w) = g^2 / |A(w)|^2 ,
</PRE>
<P>
where A(w) is short-hand notation for A(exp(jw)).  The power spectrum is
the Fourier transform of the (infinite) set of autocorrelation coefficients
The cepstrum for the autocorrelation coefficients is given by the inverse
Fourier transform of the log power spectrum. Equivalently the cepstral
coefficients are the Fourier series coefficients of the (periodic) log power
spectrum,
<P>
<PRE>
  ln[S(w)] = 2 ln[g] - ln[|A(w)|^2]
</PRE>
<P>
<PRE>
              inf
           =  SUM  c(k) exp(-jkw) .
             k=-inf
</PRE>
<P>
The cepstral coefficients are symmetric, c(-k) = c(k).  For a minimum-phase
A(z), the integral of ln[|A(w)|^2] is zero.  The coefficient c(0) is then the
average of the log power spectrum, c(0) = 2 ln[g].  This cepstral coefficient
does not affect the values of the coefficients of A(z).  An expression for
the coefficients of A(z) is obtained by expanding ln[A(w)] in a Laurent
series and taking the derivatives.  This gives the recursion
<P>
<PRE>
                1  n-1
  p(n) = c(n) - -  SUM (n-k) c(n-k) p(k),  n=1,2,...,Np .
                n  k=1
</PRE>
<P>
<DL>
<DT>
Reference:
<DD>
J. D. Markel and A. H. Gray, Jr., "Linear Prediction of Speech",
Springer-Verlag, 1976.
</DL>
<P>
Predictor coefficients are usually expressed algebraically as vectors with
1-offset indexing.  The correspondence to the 0-offset C-arrays is as
follows.
<PRE>
  p(1) &lt;==&gt; pc[0]       predictor coefficient corresponding to lag 1
  p(i) &lt;==&gt; pc[i-1]     1 &lt;= i &lt; Np
</PRE>
<H4>Parameters</H4>
<DL>
<DT>
 -&gt; const float cep[]
<DD>
Cepstral coefficients (Np+1 values).  The first cepstral coefficient
cep[0] corresponds to the zero quefrency term and is not used in the
calculation.
<DT>
&lt;-  float pc[]
<DD>
Vector of predictor coefficients (Np values).  These are the coefficients
of the predictor filter, with pc[0] being the predictor coefficient
corresponding to lag 1, and pc[Np-1] corresponding to lag Np.
<DT>
 -&gt; int Np
<DD>
Number of predictor coefficients
</DL>
<H4>Author / revision</H4>
P. Kabal  Copyright (C) 1996
/ Revision 1.9  1996/05/06
<H4>See Also</H4>
<A HREF="SPcorXpc.html">SPcorXpc</A>,
<A HREF="SPecXpc.html">SPecXpc</A>,
<A HREF="SPlsfXpc.html">SPlsfXpc</A>,
<A HREF="SPrcXpc.html">SPrcXpc</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>