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) - SPcorFilt</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>SPcorFilt</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
double SPcorFilt (double Ed, const float rxx[], const float r[], float h[],
int N)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Find filter coefficients to minimize the mean-square error
</DL>
<H4>Description</H4>
This procedure finds the filter coefficients for a linear filter which
minimizes the mean-square error. Consider a filter with N coefficients,
with coefficient h(i) corresponding to lag Nd+i. The filter output is
<PRE>
N-1
y(k) = SUM h(i) x(k-i-Nd) ,
i=0
</PRE>
where x(i) is the input signal. The filter error is
<P>
<PRE>
e(k) = d(k) - y(k) ,
</PRE>
<P>
where d(k) is the desired signal. To minimize the mean-square filtering
error, solve
<P>
<PRE>
R h = r,
</PRE>
<P>
where R is a symmetric positive definite correlation matrix, h 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) = E[x(k-i-Nd) x(k-j-Nd)], for 0 <= i,j < N,
r(i) = E[d(k) x(k-i-Nd], for 0 <= i < N.
</PRE>
<P>
For this routine, the matrix R must be symmetric and Toeplitz. Then
<P>
<PRE>
R(i,j) = rxx(|i-j|).
</PRE>
<P>
The solution is determined using Levinson's method. The resulting
mean-square filtering error can be expressed as
<P>
<PRE>
ferr = Ed - 2 h'r + h'R h
= Ed - h'r ,
</PRE>
<P>
where Ed is the mean-square value of the desired signal,
<P>
<PRE>
Ed = E[d(k)^2] .
</PRE>
<H4>Parameters</H4>
<DL>
<DT>
<- double SPcorFmse
<DD>
Resultant filter mean-square error
<DT>
-> double Ed
<DD>
Signal energy for the desired signal. This value is used only for the
computation of the mean-square error.
<DT>
-> const float rxx[]
<DD>
N element vector of autocorrelation values. Element rxx[i] is the
autocorrelation at lag i.
<DT>
-> const float r[]
<DD>
N element vector of cross-correlation values. Element r[i] is the
cross-correlation at lag Nd+i.
<DT>
<- float h[]
<DD>
N element vector of filter coefficients. Coefficient h[i] is the filter
coefficient corresponding to lag Nd+i.
<DT>
-> int N
<DD>
Number of elements in each of the vectors rxx, h and r.
</DL>
<H4>Author / revision</H4>
P. Kabal Copyright (C) 1997
/ Revision 1.4 1997/10/10
<H4>See Also</H4>
<A HREF="SPcorFmse.html">SPcorFmse</A>,
<A HREF="SPcorXpc.html">SPcorXpc</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>
|