Common spatial pattern


Common spatial pattern is a mathematical procedure used in signal processing for separating a multivariate signal into additive subcomponents which have maximum differences in variance between two windows.

Details

Let of size and of size be two windows of a multivariate signal, where is the number of signals and and are the respective number of samples.
The CSP algorithm determines the component such that the ratio of variance is maximized between the two windows:
The solution is given by computing the two covariance matrices:
Then, the simultaneous diagonalization of those two matrices is realized. We find the matrix of eigenvectors and the diagonal matrix of eigenvalues sorted by decreasing order such that:
and
with the identity matrix.
This is equivalent to the eigendecomposition of :

Discussion

Relation between variance ratio and eigenvalue

The eigenvectors composing are components with variance ratio between the two windows equal to their corresponding eigenvalue:

Other components

The vectorial subspace generated by the first eigenvectors will be the subspace maximizing the variance ratio of all components belonging to it:
On the same way, the vectorial subspace generated by the last eigenvectors will be the subspace minimizing the variance ratio of all components belonging to it:

Variance or second-order moment

CSP can be applied after a mean subtraction on signals in order to realize a variance ratio optimization. Otherwise CSP optimizes the ratio of second-order moment.

Choice of windows X1 and X2

This method can be applied to several multivariate signals but it seems that most works on it concern electroencephalographic signals.
Particularly, the method is mostly used on brain–computer interface in order to retrieve the component signals which best transduce the cerebral activity for a specific task.
It can also be used to separate artifacts from electroencephalographics signals.
The common spatial pattern needs to be adapted for the analysis of the event-related potentials.