SPcorFmse
Routine

double SPcorFmse (const float h[], double Ed, const float rxx[],
const float r[], int N)
Purpose

Calculate the meansquare filtering error
Description
This function calculates the meansquare error for a linear filter. Consider
a filter with N coefficients, with coefficient h(i) corresponding to
lag Nd+i. The filter output is
N1
y(k) = SUM h(i) x(kiNd) ,
i=0
where x(i) is the input signal. The filter error is
e(k) = d(k)  y(k) ,
where d(k) is the desired signal. The meansquare filtering error is
E[e(k)^2] or in vectormatrix notation
ferr = Ed  2 h'r + h' R h ,
The meansquare value E0, matrix R and vector p are defined as follows
Ed = E[d(k)^2]
R(i,j) = E[x(kiNd) x(kjNd], for 0 <= i,j < N,
r(i) = E[d(k) x(kiNd)], for 0 <= i < N.
For this routine, the matrix R must be symmetric and Toeplitz, viz.
R(i,j) = rxx(ij).
Linear prediction can be cast into the above form, if we let Nd=1. Also
for linear prediction, usually d(k)=x(k), giving r(i)=rxx(i).
Parameters

< double SPcorFmse

Resultant meansquare error

> const float h[]

N element vector of filter coefficients. Coefficient h[i] is the filter
coefficient corresponding to lag Nd+i.

> double Ed

Signal energy for the desired signal. This value is used only for the
computation of the meansquare error.

> const float rxx[]

N element vector of autocorrelation values. Element rxx[i] is the
autocorrelation at lag i.

> const float r[]

N element vector of crosscorrelation values. Element r[i] is the
crosscorrelation at lag Nd+i.

> int N

Number of elements in each of the vectors rxx, h and r.
Author / revision
P. Kabal
/ Revision 1.12 2003/05/09
See Also
SPcorFilt
Main Index libtsp