
Transforms the channels of the selected Sound linearly to make them white, i.e. the new channels will be uncorrelated and their variances equal unity.
We start by determining the covariance of the selected sound. Next a principal component analysis determines the eigenvalues and eigenvectors of the covariance matrix. The settings of the variance fraction to keep determines how many eigenvalues and eigenvectors we use for the whitening. This number, p, will also be equal to the number of channels of the resulting whitened sound.
In mathematical terms. For an nchannel sound, if E is the matrix with the eigenvectors and D=diag (d_{1}, d_{2},..., d_{n}) is the diagonal matrix with the eigenvalues of the covariance matrix, then the whitening matrix is W = ED^{1/2}E′, where D^{1/2}=diag (d_{1}^{1/2}, ..., d_{p}^{1/2}, 0, ..., 0). Only the p most important eigenvalues have been retained, where p was determined as the smallest integer for which (d_{1}+d_{2}+...d_{p})/(d_{1}+d_{2}+ ... + d_{n}) >= varianceFractionToKeep.
The resulting sound samples of the whitened sound, w_{ij}, are then calculated from the samples of the original sound, s_{kj}, as w_{ij} = Σ_{k} W_{ik} s_{kj}, where 1 ≤ i ≤ p, 1 ≤ j ≤ numberOfSamples and 1 ≤ k ≤ n.
© djmw 20120303