# Karhunen–Loève theorem

In the theory of stochastic processes, the Karhunen–Loève theorem (named after Kari Karhunen and Michel Loève), also known as the Kosambi–Karhunen–Loève theorem[1][2] is a representation of a stochastic process as an infinite linear combination of orthogonal functions, analogous to a Fourier series representation of a function on a bounded interval. Stochastic processes given by infinite series of this form were first[3] considered by Damodar Dharmananda Kosambi.[4] There exist many such expansions of a stochastic process: if the process is indexed over [a, b], any orthonormal basis of L2([a, b]) yields an expansion thereof in that form. The importance of the Karhunen–Loève theorem is that it yields the best such basis in the sense that it minimizes the total mean squared error.

In contrast to a Fourier series where the coefficients are real numbers and the expansion basis consists of sinusoidal functions (that is, sine and cosine functions), the coefficients in the Karhunen–Loève theorem are random variables and the expansion basis depends on the process. In fact, the orthogonal basis functions used in this representation are determined by the covariance function of the process. One can think that the Karhunen–Loève transform adapts to the process in order to produce the best possible basis for its expansion.

In the case of a centered stochastic process {Xt}t ∈ [a, b] (where centered means that the expectations E(Xt) are defined and equal to 0 for all values of the parameter t in [a, b]) satisfying a technical continuity condition, Xt admits a decomposition

${\displaystyle X_{t}=\sum _{k=1}^{\infty }Z_{k}e_{k}(t)}$

where Zk are pairwise uncorrelated random variables and the functions ek are continuous real-valued functions on [a, b] that are pairwise orthogonal in L2[a, b]. It is therefore sometimes said that the expansion is bi-orthogonal since the random coefficients Zk are orthogonal in the probability space while the deterministic functions ek are orthogonal in the time domain. The general case of a process Xt that is not centered can be brought back to the case of a centered process by considering (Xt − E(Xt)) which is a centered process.

Moreover, if the process is Gaussian, then the random variables Zk are Gaussian and stochastically independent. This result generalizes the Karhunen–Loève transform. An important example of a centered real stochastic process on [0,1] is the Wiener process; the Karhunen–Loève theorem can be used to provide a canonical orthogonal representation for it. In this case the expansion consists of sinusoidal functions.

The above expansion into uncorrelated random variables is also known as the Karhunen–Loève expansion or Karhunen–Loève decomposition. The empirical version (i.e., with the coefficients computed from a sample) is known as the Karhunen–Loève transform (KLT), principal component analysis, proper orthogonal decomposition (POD), Empirical orthogonal functions (a term used in meteorology and geophysics), or the Hotelling transform.

## Formulation

• Throughout this article, we will consider a square integrable zero-mean random process Xt defined over a probability space (Ω,F,P) and indexed over a closed interval [ab], with covariance function KX(s,t). We thus have:
${\displaystyle \forall t\in [a,b],X_{t}\in L^{2}(\Omega ,{\mathcal {F}},\mathrm {P} ),}$
${\displaystyle \forall t\in [a,b],\mathrm {E} [X_{t}]=0,}$
${\displaystyle \forall t,s\in [a,b],K_{X}(s,t)=\mathrm {E} [X_{s}X_{t}].}$
${\displaystyle {\begin{array}{rrl}T_{K_{X}}:L^{2}([a,b])&\rightarrow &L^{2}([a,b])\\f&\mapsto &\int _{[a,b]}K_{X}(s,\cdot )f(s)ds\end{array}}}$
Since TKX is a linear operator, it makes sense to talk about its eigenvalues λk and eigenfunctions ek, which are found solving the homogeneous Fredholm integral equation of the second kind
${\displaystyle \int _{[a,b]}K_{X}(s,t)e_{k}(s)\,ds=\lambda _{k}e_{k}(t)}$

## Statement of the theorem

Theorem. Let Xt be a zero-mean square integrable stochastic process defined over a probability space (Ω,F,P) and indexed over a closed and bounded interval [ab], with continuous covariance function KX(s,t).

Then KX(s,t) is a Mercer kernel and letting ek be an orthonormal basis of L2([ab]) formed by the eigenfunctions of TKX with respective eigenvalues λk, Xt admits the following representation

${\displaystyle X_{t}=\sum _{k=1}^{\infty }Z_{k}e_{k}(t)}$

where the convergence is in L2, uniform in t and

${\displaystyle Z_{k}=\int _{[a,b]}X_{t}e_{k}(t)\,dt}$

Furthermore, the random variables Zk have zero-mean, are uncorrelated and have variance λk

${\displaystyle \mathrm {E} [Z_{k}]=0,~\forall k\in \mathbb {N} \quad \quad {\mbox{and}}\quad \quad \mathrm {E} [Z_{i}Z_{j}]=\delta _{ij}\lambda _{j},~\forall i,j\in \mathbb {N} }$

Note that by generalizations of Mercer's theorem we can replace the interval [a, b] with other compact spaces C and the Lebesgue measure on [a, b] with a Borel measure whose support is C.

## Proof

• The covariance function KX satisfies the definition of a Mercer kernel. By Mercer's theorem, there consequently exists a set {λk,ek(t)} of eigenvalues and eigenfunctions of TKX forming an orthonormal basis of L2([a,b]), and KX can be expressed as
${\displaystyle K_{X}(s,t)=\sum _{k=1}^{\infty }\lambda _{k}e_{k}(s)e_{k}(t)}$
• The process Xt can be expanded in terms of the eigenfunctions ek as:
${\displaystyle X_{t}=\sum _{k=1}^{\infty }Z_{k}e_{k}(t)}$
where the coefficients (random variables) Zk are given by the projection of Xt on the respective eigenfunctions
${\displaystyle Z_{k}=\int _{[a,b]}X_{t}e_{k}(t)\,dt}$
• We may then derive
${\displaystyle \mathrm {E} [Z_{k}]=\mathrm {E} \left[\int _{[a,b]}X_{t}e_{k}(t)\,dt\right]=\int _{[a,b]}\mathrm {E} [X_{t}]e_{k}(t)dt=0}$
and:
${\displaystyle {\begin{array}{rl}\mathrm {E} [Z_{i}Z_{j}]&=\mathrm {E} \left[\int _{[a,b]}\int _{[a,b]}X_{t}X_{s}e_{j}(t)e_{i}(s)dt\,ds\right]\\&=\int _{[a,b]}\int _{[a,b]}\mathrm {E} \left[X_{t}X_{s}\right]e_{j}(t)e_{i}(s)dt\,ds\\&=\int _{[a,b]}\int _{[a,b]}K_{X}(s,t)e_{j}(t)e_{i}(s)dt\,ds\\&=\int _{[a,b]}e_{i}(s)\left(\int _{[a,b]}K_{X}(s,t)e_{j}(t)dt\right)ds\\&=\lambda _{j}\int _{[a,b]}e_{i}(s)e_{j}(s)ds\\&=\delta _{ij}\lambda _{j}\end{array}}}$
where we have used the fact that the ek are eigenfunctions of TKX and are orthonormal.
{\displaystyle {\begin{aligned}\mathrm {E} [|X_{t}-S_{N}|^{2}]&=\mathrm {E} [X_{t}^{2}]+\mathrm {E} [S_{N}^{2}]-2\mathrm {E} [X_{t}S_{N}]\\&=K_{X}(t,t)+\mathrm {E} \left[\sum _{k=1}^{N}\sum _{l=1}^{N}Z_{k}Z_{l}e_{k}(t)e_{l}(t)\right]-2\mathrm {E} \left[X_{t}\sum _{k=1}^{N}Z_{k}e_{k}(t)\right]\\&=K_{X}(t,t)+\sum _{k=1}^{N}\lambda _{k}e_{k}(t)^{2}-2\mathrm {E} \left[\sum _{k=1}^{N}\int _{a}^{b}X_{t}X_{s}e_{k}(s)e_{k}(t)ds\right]\\&=K_{X}(t,t)-\sum _{k=1}^{N}\lambda _{k}e_{k}(t)^{2}\end{aligned}}}
which goes to 0 by Mercer's theorem.

## Properties of the Karhunen–Loève transform

### Special case: Gaussian distribution

Since the limit in the mean of jointly Gaussian random variables is jointly Gaussian, and jointly Gaussian random (centered) variables are independent if and only if they are orthogonal, we can also conclude:

Theorem. The variables Zi have a joint Gaussian distribution and are stochastically independent if the original process {Xt}t is Gaussian.

In the Gaussian case, since the variables Zi are independent, we can say more:

${\displaystyle \lim _{N\rightarrow \infty }\sum _{i=1}^{N}e_{i}(t)Z_{i}(\omega )=X_{t}(\omega )}$

almost surely.

### The Karhunen–Loève transform decorrelates the process

This is a consequence of the independence of the Zk.

### The Karhunen–Loève expansion minimizes the total mean square error

In the introduction, we mentioned that the truncated Karhunen–Loeve expansion was the best approximation of the original process in the sense that it reduces the total mean-square error resulting of its truncation. Because of this property, it is often said that the KL transform optimally compacts the energy.

More specifically, given any orthonormal basis {fk} of L2([a, b]), we may decompose the process Xt as:

${\displaystyle X_{t}(\omega )=\sum _{k=1}^{\infty }A_{k}(\omega )f_{k}(t)}$

and we may approximate Xt by the finite sum ${\displaystyle {\hat {X}}_{t}(\omega )=\sum _{k=1}^{N}A_{k}(\omega )f_{k}(t)}$ for some integer N.

Claim. Of all such approximations, the KL approximation is the one that minimizes the total mean square error (provided we have arranged the eigenvalues in decreasing order).

### Explained variance

An important observation is that since the random coefficients Zk of the KL expansion are uncorrelated, the Bienaymé formula asserts that the variance of Xt is simply the sum of the variances of the individual components of the sum:

{\displaystyle {\begin{aligned}{\mbox{Var}}[X_{t}]&=\sum _{k=0}^{\infty }e_{k}(t)^{2}{\mbox{Var}}[Z_{k}]=\sum _{k=1}^{\infty }\lambda _{k}e_{k}(t)^{2}\end{aligned}}}

Integrating over [a, b] and using the orthonormality of the ek, we obtain that the total variance of the process is:

${\displaystyle \int _{[a,b]}{\mbox{Var}}[X_{t}]dt=\sum _{k=1}^{\infty }\lambda _{k}}$

In particular, the total variance of the N-truncated approximation is ${\displaystyle \sum _{k=1}^{N}\lambda _{k}}$. As a result, the N-truncated expansion explains ${\displaystyle \sum _{k=1}^{N}\lambda _{k}/\sum _{k=1}^{\infty }\lambda _{k}}$ of the variance; and if we are content with an approximation that explains, say, 95% of the variance, then we just have to determine an ${\displaystyle N\in \mathbb {N} }$ such that ${\displaystyle \sum _{k=1}^{N}\lambda _{k}/\sum _{k=1}^{\infty }\lambda _{k}\geq 0.95}$.

## Linear Karhunen-Loeve Approximations

Let us consider a whole class of signals we want to approximate over the first M vectors of a basis. These signals are modeled as realizations of a random vector Y[n] of size N. To optimize the approximation we design a basis that minimizes the average approximation error. This section proves that optimal bases are karhunen-loeve bases that diagonalize the covariance matrix of Y. The random vector Y can be decomposed in an orthogonal basis ${\displaystyle {{\left\{{{g}_{m}}\right\}}_{0\leq m\leq N}}:}$

is a random variable. The approximation from the first ${\displaystyle M\leq N}$ vectors of the basis is

The energy conservation in an orthogonal basis implies

This error is related to the covariance of Y defined by

For any vector x[n] we denote by K the covariance operator represented by this matrix,

The error ${\displaystyle \varepsilon \left[M\right]}$ is therefore a sum of the last N-M coefficients of the covariance operator

The covariance operator K is Hermitian and Positive and is thus diagonalized in an orthogonal basis called a Karhunen-Loeve basis. The following theorem states that a Karhunen-Loeve basis is optimal for linear approximations.

Theorem:(Optimality of Karhunen-Loeve basis) Let K be acovariance operator. For all ${\displaystyle M\geq 1}$, the approximation error

is minimum if and only if ${\displaystyle {{\left\{{{g}_{m}}\right\}}_{0\leq m is a Karhunen-Loeve basis ordered by decreasing eigenvalues.

## Non-Linear Approximation in Bases

Linear approximations project the signal on M vectors a priori. The approximation can be made more precise by choosing the M orthogonal vectors depending on the signal properties. This section analyzes the general performance of these non-linear approximations. A signal ${\displaystyle f\in \mathrm {H} }$ is approximated with M vectors selected adaptively in an orthonormal basis ${\displaystyle \mathrm {B} ={{\left\{{{g}_{m}}\right\}}_{m\in \mathbb {N} }}}$ of ${\displaystyle \mathrm {H} }$. Let ${\displaystyle {{f}_{M}}}$ be the projection of f over M vectors whose indices are in ${\displaystyle {{I}_{M}}}$:

The approximation error is the sum of the remaining coefficients

To minimize this error, the indices in ${\displaystyle {{I}_{M}}}$ must correspond to the M vectors having the largest inner product amplitude ${\displaystyle \left|\left\langle f,{{g}_{m}}\right\rangle \right|}$. These are the vectors that best correlate f. They can thus be interpreted as the main features of f. The resulting error is necessarily smaller than the error of a linear approximation which selects the M approximation vectors independently of f. Let us sort ${\displaystyle {{\left\{\left|\left\langle f,{{g}_{m}}\right\rangle \right|\right\}}_{m\in \mathbb {N} }}}$ in decreasing order :${\displaystyle \left|\left\langle f,{{g}_{{m}_{k}}}\right\rangle \right|\geq \left|\left\langle f,{{g}_{{m}_{k+1}}}\right\rangle \right|}$. The best non-linear approximation is

It can also be written as inner product thresholding:

The non-linear error is

this error goes quickly to zero as M increases,if the sorted values of ${\displaystyle \left|\left\langle f,{{g}_{{m}_{k}}}\right\rangle \right|}$ have a fast decay as k increases. This decay is quantified by computing the ${\displaystyle {{\mathrm {I} }^{\mathrm {P} }}}$ norm of the signal inner products in B:

The following theorem relates the decay of ${\displaystyle \varepsilon \left[M\right]}$ to ${\displaystyle {{\left\|f\right\|}_{\mathrm {B} ,p}}}$

### Non-optimality of Karhunen-Loéve Bases

To further illustrate the differences between linear and non -linear approximations, we study the decomposition of a simple non-Gaussian random vector in a Karhunen-Loéve basis. Processes whose realizations have a random translation are stationary. The Karhunen-Loéve basis is then a Fourier basis and we study its performance. To simplify the analysis, consider a random vector Y[n] of size N that is random shift modulo N of a deterministic signal f[n] of zero mean ${\displaystyle \sum \nolimits _{n=0}^{N-1}{f\left[n\right]=0}}$:

The random shift P is uniformly distributed on [0,N-1]:

Clearly

and

Since RY is N periodic, Y is a circular stationary random vector. The covariance operator is a circular convolution with RY and is therefore diagonalized in the discrete Fourier Karhunen-Loéve basis ${\displaystyle {{\left\{{\frac {1}{\sqrt {N}}}{{e}^{\frac {i2\pi mn}{N}}}\right\}}_{0\leq m. The power spectrum is Fourier Transform of RY:

Example: Consider an extreme case where ${\displaystyle f\left[n\right]=\delta \left[n\right]-\delta \left[n-1\right]}$ A theorem stated above guarantees that the Fourier Karhunen-Loéve basis produces a smaller expected approximation error than a canonical basis of Diracs ${\displaystyle {{\left\{{{g}_{m}}\left[n\right]=\delta \left[n-m\right]\right\}}_{0\leq m. Indeed we do not know a priori the abscissa of the non-zero coefficients of Y, so there is no particular Dirac that is better adapted to perform the approximation . But the Fourier vectors cover the whole support of Y and thus absorb a part of the signal energy.

Selecting higher frequency Fourier coefficients yields a better mean-square approximation than choosing a priori a few Dirac vectors to perform the approximation. The situation is totally different for non-linear approximations. If ${\displaystyle f\left[n\right]=\delta \left[n\right]-\delta \left[n-1\right]}$ then the discrete Fourier basis is extremely inefficient because f and hence Y have an energy that is almost uniformly spread among all Fourier vectors. In contrast, since f has only two non-zero coefficients in the Dirac basis, a non-linear approximation of Y with ${\displaystyle M\geq 2}$ gives zero error. [5]

## Principal component analysis

{{#invoke:main|main}}

We have established the Karhunen–Loève theorem and derived a few properties thereof. We also noted that one hurdle in its application was the numerical cost of determining the eigenvalues and eigenfunctions of its covariance operator through the Fredholm integral equation of the second kind ${\displaystyle \int _{[a,b]}K_{X}(s,t)e_{k}(s)\,ds=\lambda _{k}e_{k}(t)}$ .

However, when applied to a discrete and finite process ${\displaystyle \left(X_{n}\right)_{n\in \{1,\ldots ,N\}}}$, the problem takes a much simpler form and standard algebra can be used to carry out the calculations.

Note that a continuous process can also be sampled at N points in time in order to reduce the problem to a finite version.

We henceforth consider a random N-dimensional vector ${\displaystyle X=\left(X_{1}~X_{2}~\ldots ~X_{N}\right)^{T}}$. As mentioned above, X could contain N samples of a signal but it can hold many more representations depending on the field of application. For instance it could be the answers to a survey or economic data in an econometrics analysis.

As in the continuous version, we assume that X is centered, otherwise we can let ${\displaystyle X:=X-\mu _{X}}$ (where ${\displaystyle \mu _{X}}$ is the mean vector of X) which is centered.

Let us adapt the procedure to the discrete case.

### Covariance matrix

Recall that the main implication and difficulty of the KL transformation is computing the eigenvectors of the linear operator associated to the covariance function, which are given by the solutions to the integral equation written above.

Define Σ, the covariance matrix of X. Σ is an N by N matrix whose elements are given by:

${\displaystyle \Sigma _{ij}=E[X_{i}X_{j}],\qquad \forall i,j\in \{1,\ldots ,N\}}$

Rewriting the above integral equation to suit the discrete case, we observe that it turns into:

{\displaystyle {\begin{aligned}&\sum _{i=1}^{N}\Sigma _{ij}e_{j}=\lambda e_{i}\\\Leftrightarrow \quad &\Sigma e=\lambda e\end{aligned}}}

where ${\displaystyle e=(e_{1}~e_{2}~\ldots ~e_{N})^{T}}$ is an N-dimensional vector.

The integral equation thus reduces to a simple matrix eigenvalue problem, which explains why the PCA has such a broad domain of applications.

Since Σ is a positive definite symmetric matrix, it possesses a set of orthonormal eigenvectors forming a basis of ${\displaystyle \mathbb {R} ^{N}}$, and we write ${\displaystyle \{\lambda _{i},\phi _{i}\}_{i\in \{1,\ldots ,N\}}}$ this set of eigenvalues and corresponding eigenvectors, listed in decreasing values of λi. Let also ${\displaystyle \Phi }$ be the orthonormal matrix consisting of these eigenvectors:

{\displaystyle {\begin{aligned}\Phi &:=\left(\phi _{1}~\phi _{2}~\ldots ~\phi _{N}\right)^{T}\\\Phi ^{T}\Phi &=I\end{aligned}}}

### Principal component transform

It remains to perform the actual KL transformation, called the principal component transform in this case. Recall that the transform was found by expanding the process with respect to the basis spanned by the eigenvectors of the covariance function. In this case, we hence have:

{\displaystyle {\begin{aligned}X&=\sum _{i=1}^{N}\langle \phi _{i},X\rangle \phi _{i}\\&=\sum _{i=1}^{N}\phi _{i}^{T}X\phi _{i}\end{aligned}}}

In a more compact form, the principal component transform of X is defined by:

${\displaystyle \left\{{\begin{array}{rl}Y&=\Phi ^{T}X\\X&=\Phi Y\end{array}}\right.}$

The i-th component of Y is ${\displaystyle Y_{i}=\phi _{i}^{T}X}$, the projection of X on ${\displaystyle \phi _{i}}$ and the inverse transform ${\displaystyle X=\Phi Y}$ yields the expansion of ${\displaystyle X}$ on the space spanned by the ${\displaystyle \phi _{i}}$:

${\displaystyle X=\sum _{i=1}^{N}Y_{i}\phi _{i}=\sum _{i=1}^{N}\langle \phi _{i},X\rangle \phi _{i}}$

As in the continuous case, we may reduce the dimensionality of the problem by truncating the sum at some ${\displaystyle K\in \{1,\ldots ,N\}}$ such that ${\displaystyle {\frac {\sum _{i=1}^{K}\lambda _{i}}{\sum _{i=1}^{N}\lambda _{i}}}\geq \alpha }$ where α is the explained variance threshold we wish to set.

We can also reduce the dimensionality through the use of multilevel dominant eigenvector estimation (MDEE).[6]

## Examples

### The Wiener process

There are numerous equivalent characterizations of the Wiener process which is a mathematical formalization of Brownian motion. Here we regard it as the centered standard Gaussian process Wt with covariance function

${\displaystyle K_{W}(t,s)=\operatorname {Cov} (W_{t},W_{s})=\min(s,t).}$

We restrict the time domain to [a,b]=[0,1] without loss of generality.

The eigenvectors of the covariance kernel are easily determined. These are

${\displaystyle e_{k}(t)={\sqrt {2}}\sin \left(\left(k-\textstyle {\frac {1}{2}}\right)\pi t\right)}$

and the corresponding eigenvalues are

${\displaystyle \lambda _{k}={\frac {1}{(k-{\frac {1}{2}})^{2}\pi ^{2}}}.}$

This gives the following representation of the Wiener process:

Theorem. There is a sequence {Zi}i of independent Gaussian random variables with mean zero and variance 1 such that

${\displaystyle W_{t}={\sqrt {2}}\sum _{k=1}^{\infty }Z_{k}{\frac {\sin \left(\left(k-{\frac {1}{2}}\right)\pi t\right)}{\left(k-{\frac {1}{2}}\right)\pi }}.}$

Note that this representation is only valid for ${\displaystyle t\in [0,1].}$ On larger intervals, the increments are not independent. As stated in the theorem, convergence is in the L2 norm and uniform in t.

### The Brownian bridge

Similarly the Brownian bridge ${\displaystyle B_{t}=W_{t}-tW_{1}}$ which is a stochastic process with covariance function

${\displaystyle K_{B}(t,s)=\min(t,s)-ts}$

can be represented as the series

${\displaystyle B_{t}=\sum _{k=1}^{\infty }Z_{k}{\frac {{\sqrt {2}}\sin(k\pi t)}{k\pi }}}$

## Applications

Template:Expand section Adaptive optics systems sometimes use K–L functions to reconstruct wave-front phase information (Dai 1996, JOSA A). Karhunen–Loève expansion is closely related to the Singular Value Decomposition. The latter has myriad applications in image processing, radar, seismology, and the like. If one has independent vector observations from a vector valued stochastic process then the left singular vectors are maximum likelihood estimates of the ensemble KL expansion.

### Applications in signal estimation and detection

#### Detection of a known continuous signal S(t)

In communication, we usually have to decide whether a signal from a noisy channel contains valuable information. The following hypothesis testing is used for detecting continuous signal s(t) from channel output X(t), N(t) is the channel noise, which is usually assumed zero mean gaussian process with correlation function ${\displaystyle R_{N}(t,s)=E[N(t)N(s)]}$

#### Signal detection in white noise

When the channel noise is white, its correlation function is

${\displaystyle R_{N}(t)={\frac {N_{0}}{2}}\delta (t)}$,

and it has constant power spectrum density. In physically practical channel, the noise power is finite, so:

${\displaystyle S_{N}(f)={\frac {N_{0}}{2}}{\text{ for }}|f|w}$.

Then the noise correlation function is sinc function with zeros at ${\displaystyle {\frac {n}{2\omega }},n=...-1,0,1,...}$ . Since are uncorrelated and gaussian, they are independent. Thus we can take samples from X(t) with time spacing

${\displaystyle \Delta t={\frac {n}{2\omega }}}$ within (0,T).

Let ${\displaystyle X_{i}=X(i\Delta t)}$. We have a total of ${\displaystyle n={\frac {T}{\Delta t}}=T(2\omega )=2\omega T}$ i.i.d samples ${\displaystyle \{X_{1},X_{2},...,X_{n}\}}$ to develop the likelihood-ratio test. Define signal ${\displaystyle S_{i}=S(i\Delta t)}$, the problem becomes,

${\displaystyle H:X_{i}=N_{i}}$,
${\displaystyle K:X_{i}=N_{i}+S_{i},i=1,2...n.}$

The log-likelihood ratio

${\displaystyle {\mathcal {L}}({\underline {x}})=\log {\frac {\sum _{i=1}^{n}(2S_{i}x_{i}-S_{i}^{2})}{2\sigma ^{2}}}\Leftrightarrow \Delta t\Sigma _{i=1}^{n}S_{i}x_{i}=\sum _{i=1}^{n}S(i\Delta t)x(i\Delta t)\Delta t\gtrless \lambda _{2}}$.

Then G is the test statistics and the Neyman–Pearson optimum detector is:${\displaystyle G({\underline {x}})>G_{0}\Rightarrow K,. As G is gaussian, we can characterize it by finding its mean and variances. Then we get

${\displaystyle H:G\sim N(0,{\frac {N_{0}E}{2}})}$
${\displaystyle K:G\sim N(E,{\frac {N_{0}E}{2}})}$,

where ${\displaystyle E=\int _{0}^{T}S^{2}(t)dt}$ is the signal energy.

The false alarm error

${\displaystyle \alpha =\int _{G_{0}}^{\infty }N(0,{\frac {N_{0}E}{2}})dG\Rightarrow G_{0}={\sqrt {\frac {N_{0}E}{2}}}\Phi ^{-1}(1-\alpha )}$

And the probability of detection:

${\displaystyle \beta =\int _{G_{0}}^{\infty }N(E,{\frac {N_{0}E}{2}})dG=1-\Phi ({\frac {G_{0}-E}{\sqrt {\frac {N_{0}E}{2}}}})=\Phi [{\sqrt {\frac {2E}{N_{0}}}}-\Phi ^{-1}(1-\alpha )],\Phi (\cdot )}$ is the cdf of standard normal gaussian variable.

#### Signal detection in colored noise

When N(t) is colored (correlated in time) gaussian noise with zero mean and covariance function ${\displaystyle R_{N}(t,s)=E[X(t)X(s)],}$ we cannot sample independent discrete observations by evenly spacing the time. Instead, we can use K–L expansion to uncorrelate the noise process and get independent gaussian observation 'samples'. The K–L expansion of N(t):

${\displaystyle N(t)=\sum _{i=1}^{\infty }N_{i}\Phi _{i}(t),0,

where ${\displaystyle N_{i}=\int N(t)\Phi _{i}(t)dt}$ and the orthonormal bases ${\displaystyle \{\Phi _{i}{t}\}}$are generated by kernal ${\displaystyle R_{N}(t,s)}$, i.e., solution to

${\displaystyle \int _{0}^{T}R_{N}(t,s)\Phi _{i}(s)ds=\lambda _{i}\Phi _{i}(t),var[N_{i}]=\lambda _{i}}$.

Do the expansion:

${\displaystyle S(t)=\sum _{i=1}^{\infty }S_{i}\Phi _{i}(t)}$,
${\displaystyle X_{i}=\int _{0}^{T}X(t)\Phi _{i}(t)dt=N_{i}}$
${\displaystyle {N_{i}}}$ are independent gaussian r.v's with variance ${\displaystyle \lambda _{i}}$
under H: ${\displaystyle \{X_{i}\}}$ are independent gaussian r.v's. ${\displaystyle f_{H}[x(t)|0
under K: ${\displaystyle \{X_{i}-S_{i}\}}$ are independent gaussian r.v's. ${\displaystyle f_{K}[x(t)|0

Hence, the log-LR is given by

${\displaystyle {\mathcal {L}}({\underline {x}})=\sum _{i=1}^{\infty }{\frac {2S_{i}x_{i}-S_{i}^{2}}{2\lambda _{i}}}}$

and the optimum detector is

${\displaystyle G=\sum _{i=1}^{\infty }S_{i}x_{i}\lambda _{i}>G_{0}\Rightarrow K,

Define

${\displaystyle k(t)=\sum _{i=1}^{\infty }\lambda _{i}S_{i}\Phi _{i}(t),0
##### How to find k(t)

Since

${\displaystyle \int _{0}^{T}R_{N}(t,s)k(s)ds=\sum _{i=1}^{\infty }\lambda _{i}S_{i}\int _{0}^{T}R_{N}(t,s)\Phi _{i}(s)ds=\sum _{i=1}^{\infty }S_{i}\Phi _{i}(t)=S(t)}$,

k(t) is the solution to

${\displaystyle \int _{0}^{T}R_{N}(t,s)k(s)ds=S(t)}$.

If N(t)is wide-sense stationary,

${\displaystyle \int _{0}^{T}R_{N}(t-s)k(s)ds=S(t)}$,

which is known as the Wiener–Hopf equation. The equation can be solved by taking fourier transform, but not practically realizable since infinite spectrum needs spatial factorization. A special case which is easy to calculate k(t) is white gaussian noise.

${\displaystyle \int _{0}^{T}{\frac {N_{0}}{2}}\delta (t-s)k(s)ds=S(t)\Rightarrow k(t)=CS(t),0.

The corresponding impulse response is h(t) = k(T-t) = C S(T-t). Let C = 1, this is just the result we arrived at in previous section for detecting of signal in white noise.

##### Test threshold for Neyman–Pearson detector

Since X(t)is gaussian process, ${\displaystyle G=\int _{0}^{T}k(t)x(t)dt}$ is a gaussian random variable that can be characterized by its mean and variance.

${\displaystyle E[G|H]=\int _{0}^{T}k(t)E[x(t)|H]dt=0}$
${\displaystyle E[G|K]=\int _{0}^{T}k(t)E[x(t)|K]dt=\int _{0}^{T}k(t)S(t)dt\equiv \rho }$
${\displaystyle E[G^{2}|H]=\int _{0}^{T}\int _{0}^{T}k(t)k(s)R_{N}(t,s)dtds=\int _{0}^{T}k(t)(\int _{0}^{T}k(s)R_{N}(t,s)ds)=\int _{0}^{T}k(t)S(t)dt=\rho }$
${\displaystyle var[G|H]=E[G^{2}|H]-(E[G|H])^{2}=\rho }$
${\displaystyle E[G^{2}|K]=\int _{0}^{T}\int _{0}^{T}k(t)k(s)E[x(t)x(s)]dtds=\int _{0}^{T}\int _{0}^{T}k(t)k(s)(R_{N}(t,s)+S(t)S(s))dtds=\rho +\rho ^{2}}$
${\displaystyle var[G|K]=E[G^{2}|K]-(E[G|K])^{2}=\rho +\rho ^{2}-\rho ^{2}=\rho .}$

Hence, we obtain the distributions of H and K:

${\displaystyle H:G\sim N(0,\rho )}$
${\displaystyle K:G\sim N(\rho ,\rho )}$

The false alarm error is

${\displaystyle \alpha =\int _{G_{0}}^{\infty }N(0,\rho )dG=1-\Phi ({\frac {G_{0}}{\sqrt {\rho }}}).}$

So the test threshold for the Neyman–Pearson optimum detector is

${\displaystyle G_{0}={\sqrt {\rho }}\Phi ^{-1}(1-\alpha )}$.

Its power of detection is

${\displaystyle \beta =\int _{G_{0}}^{\infty }N(\rho ,\rho )dG=\Phi [{\sqrt {\rho }}-\Phi ^{-1}(1-\alpha )]}$.

When the noise is white gaussian process, the signal power is

${\displaystyle \rho =\int _{0}^{T}k(t)S(t)dt=\int _{0}^{T}S(t)^{2}dt=E}$.
##### Prewhitening

For some type of colored noise, a typical practise is to add a prewhitening filter before the matched filter to transform the colored noise into white noise. For example, N(t) is a wide-sense stationary colored noise with correlation function

${\displaystyle \mathbb {R} _{N}(\tau )={\frac {BN_{0}}{4}}e^{-B|\tau |}}$
and ${\displaystyle S_{N}(f)={\frac {N_{0}}{2(1+({\frac {w}{B}})^{2})}}}$.

The transfer function of prewhitening filter is ${\displaystyle H(f)=1+j{\frac {w}{B}}}$.

#### Detection of a gaussian random signal in AWGN

When the signal we want to detect from the noisy channel is also random, for example, a white gaussian process X(t), we can still implement K–L expansion to get independent sequence of observation. In this case, the detection problem is described as follows:

${\displaystyle H_{0}:Y(t)=N(t)}$
${\displaystyle H_{1}:Y(t)=N(t)+X(t),0

X(t) is a random process with correlation function ${\displaystyle R_{X}(t,s)=E\{X[t]X[s]\}}$

The K–L expansion of X(t) is

${\displaystyle X(t)=\sum _{i=1}^{\infty }X_{i}\Phi _{i}(t)}$,

where

${\displaystyle X_{i}=\int _{0}^{T}X(t)\Phi _{i}(t).\Phi (t)}$

are solutions to

${\displaystyle \int _{0}^{T}R_{X}(t,s)\Phi _{i}(s)ds=\lambda _{i}\Phi _{i}(t)}$.

So ${\displaystyle X_{i}}$'s are independent sequence of r.v's with zero mean and variance ${\displaystyle \lambda _{i}}$. Expanding Y(t) and N(t) by ${\displaystyle \Phi _{i}(t)}$, we get

${\displaystyle Y_{i}=\int _{0}^{T}Y(t)\Phi _{i}(t)dt=\int _{0}^{T}[N(t)+X(t)]\Phi _{i}(t)=N_{i}+X_{i}}$,

As N(t) is gaussian white noise, ${\displaystyle N_{i}}$'s are i.i.d sequence of r.v with zero mean and variance${\displaystyle {\frac {N_{0}}{2}}}$, then the problem is simplified as follows,

${\displaystyle H_{0}:Y_{i}=N_{i}}$
${\displaystyle H_{1}:Y_{i}=N_{i}+X_{i}}$

The Neyman–Pearson optimal test:

${\displaystyle \Lambda ={\frac {f_{Y}|H_{1}}{f_{Y}|H_{0}}}=Ce^{-\sum _{i=1}^{\infty }{\frac {y_{i}^{2}}{2}}{\frac {\lambda _{i}}{{\frac {N_{0}}{2}}({\frac {N_{0}}{2}}+\lambda _{i})}}}}$,

so the log-likelihood ratio

${\displaystyle {\mathcal {L}}=ln(\Lambda )=K-\sum _{i=1}^{\infty }{\frac {y_{i}^{2}}{2}}{\frac {\lambda _{i}}{{\frac {N_{0}}{2}}({\frac {N_{0}}{2}}+\lambda _{i})}}}$.

Since

${\displaystyle {\hat {X_{i}}}={\frac {\lambda _{i}}{{\frac {N_{0}}{2}}({\frac {N_{0}}{2}}+\lambda _{i})}}}$

is just the minimum-mean-square estimate of ${\displaystyle X_{i}}$ given ${\displaystyle Y_{i}}$'s,

${\displaystyle {\mathcal {L}}=K+{\frac {1}{N_{0}}}\sum _{i=1}^{\infty }Y_{i}{\hat {X_{i}}}}$.

K–L expansion has the following property: If

${\displaystyle f(t)=\sum f_{i}\Phi _{i}(t),g(t)=\sum g_{i}\Phi _{i}(t)}$,

where

${\displaystyle f_{i}=\int _{0}^{T}f(t)\Phi _{i}(t),g_{i}=\int _{0}^{T}g(t)\Phi _{i}(t).}$,

then

${\displaystyle \sum _{i=1}^{\infty }f_{i}g_{i}=\int _{0}^{T}g(t)f(t)dt}$.

So let

${\displaystyle {\hat {X(t|T)}}=\sum _{i=1}^{\infty }{\hat {X_{i}}}\Phi _{i}(t)}$, ${\displaystyle {\mathcal {L}}=K+{\frac {1}{N_{0}}}\int _{0}^{T}Y(t){\hat {X(t|T)}}dt}$.

Noncausal filter Q(t, s) can be used to get the estimate through

${\displaystyle {\hat {X(t|T)}}=\int _{0}^{T}Q(t,s)Y(s)ds}$.

By orthogonality principle, Q(t,s) satisfies

${\displaystyle \int _{0}^{T}Q(t,s)R_{X}(s,t)ds+{\frac {N_{0}}{2}}Q(t,\lambda )=R_{X}(t,\lambda ),0<\lambda .

However for practical reason, it's necessary to further derive the causal filter h(t, s), where h(t, s) = 0 for s > t, to get estimate ${\displaystyle {\hat {X(t|t)}}}$. Specifically,

${\displaystyle Q(t,s)=h(t,s)+h(s,t)-\int _{0}^{T}h(\lambda ,t)h(s,\lambda )d\lambda }$.

## Notes

1. {{#invoke:citation/CS1|citation |CitationClass=citation }}
2. {{#invoke:citation/CS1|citation |CitationClass=citation }}
3. {{#invoke:citation/CS1|citation |CitationClass=citation }}
4. {{#invoke:citation/CS1|citation |CitationClass=citation }}.
5. A wavelet tour of signal processing-Stéphane Mallat
6. X. Tang, “Texture information in run-length matrices,” IEEE Transactions on Image Processing, vol. 7, No. 11, pp. 1602- 1609, Nov. 1998

## References

• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• Wu B., Zhu J., Najm F.(2005) "A Non-parametric Approach for Dynamic Range Estimation of Nonlinear Systems". In Proceedings of Design Automation Conference(841-844) 2005
• Wu B., Zhu J., Najm F.(2006) "Dynamic Range Estimation". IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, Vol. 25 Issue:9 (1618-1636) 2006
• Template:Cite arXiv
• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

|CitationClass=journal }}