Last active
October 14, 2017 09:01
-
-
Save localmin/bf272f79ee64d354f057941f767e892b to your computer and use it in GitHub Desktop.
Matlab Function for Joint Diagonalize for BSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function G = JointDiagonalize( S ) | |
[ ~, N ] = size( S ); | |
halfN = N / 2; | |
% Make two Correlation matrices | |
S1 = S(:,1:halfN); | |
S2 = S(:,halfN + 1:N); | |
Ex1 = (S1 * S1')/halfN; | |
[ P1, D1 ] = eig( Ex1 ); | |
rD1_inv = D1^(-1/2); | |
Gd = rD1_inv * P1'; | |
Ex2 = (S2 * S2')/halfN; | |
Ex2d = Gd * Ex2 * Gd'; | |
[ P2, ~ ] = eig( Ex2d ); | |
G = P2' * Gd; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment