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 118 119 120 121 122 123 124 125 126 127 128 129 130
|
<HTML>
<HEAD>
<TITLE>TSP (libtsp/SP) - SPcovMXpc</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>SPcovMXpc</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
double SPcovMXpc (const float *Cov[], float pc[], int Np)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Find predictor coefficients using the modified covariance method
</DL>
<H4>Description</H4>
This procedure finds the predictor coefficients for a linear predictor using
the modified covariance method which guarantees a minimum phase prediction
error filter.
<P>
Consider a linear predictor with Np coefficients,
<PRE>
Np
y(k) = SUM p(i) x(k-i) ,
i=1
</PRE>
where x(i) is the input signal. This procedure starts by solving for
predictors of increasing order as in the case of the standard covariance
method. The modified covariance procedure calculates the ratio of the error
signal energies for predictors of successive orders. In the autocorrelation
method the residual error energy for an n'th order predictor is given by
<PRE>
n 2
Perr(n) = Ex PROD [1 - k (i)],
i=0
</PRE>
where k(i) is a reflection coefficient. In the modified covariance method,
the ratios of error energies for the covariance method solution are used to
determine the reflection coefficients. The sign of k(i) is determined from
the sign of the i'th predictor coefficient. The covariance method predictor
coefficients are discarded; instead a set of predictor coefficients is
derived from the reflection coefficients. Since the error energy decreases
with predictor order, the reflection coefficients are less than unity in
magnitude. This also means that the predictor coefficients derived from them
correspond to a minimum phase prediction error filter.
<P>
The equations for the standard covariance method are
<P>
<PRE>
R p = r,
</PRE>
<P>
where R is a symmetric positive definite covariance matrix, p is a vector
of filter coefficients and r is a vector of correlation values. The matrix
R and and vector r are defined as follows
<P>
<PRE>
R(i,j) = Cov(i,j) = E[x(k-i) x(k-j)], for 1 <= i,j <= N,
r(i) = Cov(0,i) = E[x(k) x(k-i)], for 1 <= i <= N.
</PRE>
<P>
The solution is found using a Cholesky decomposition of the matrix R. The
resulting mean-square prediction error for the standard covariance method can
be expressed as
<P>
<PRE>
perr = Ex - 2 p'r + p'R p
= Ex - p'r ,
</PRE>
<P>
where Ex is the mean-square value of the input signal,
<P>
<PRE>
Ex = Cov(0,0) = E[x(k)^2].
</PRE>
<P>
If the coefficient matrix is numerically not positive definite, or if the
prediction error energy becomes negative at some stage in the calculation,
the remaining predictor coefficients are set to zero.
<P>
The expectation operator E[.] is often replaced by a sum over k over a finite
interval. Minimization of the prediction error over this interval defines
the so-called covariance method for determining the linear prediction
coefficients.
<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) <==> pc[0] predictor coefficient corresponding to lag 1
p(i) <==> pc[i-1] 1 <= i < Np
</PRE>
<H4>Parameters</H4>
<DL>
<DT>
<- double SPcovXpc
<DD>
Resulting prediction error energy. This is the prediction error for the
coefficients returned by this routine.
<DT>
-> const float *Cov[]
<DD>
Cov is an array of pointers to the rows of an Np+1 by Np+1 symmetric
positive definite correlation matrix. Only the lower triangular portion
of Cov is accessed. Note that with ANSI C, if the actual parameter
is not declared to have the const attribute, an explicit cast to
(const float **) is required.
<DT>
<- const float pc[]
<DD>
Np element vector of predictor coefficients. Coefficient pc[i] is the
predictor coefficient corresponding to lag i+1.
<DT>
-> int Np
<DD>
Number of predictor coefficients
</DL>
<H4>Author / revision</H4>
P. Kabal Copyright (C) 1998
/ Revision 1.7 1998/06/13
<H4>See Also</H4>
<A HREF="SPcovXpc.html">SPcovXpc</A>,
<A HREF="SPcovar.html">SPcovar</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>
|