I am trying to solve the Cocktail Party Problem. I am trying to separate these two mixed audio files:
into 2 separate audio files that contain the 2 original sources, like this:
I found that it can supposedly be accomplished fairly easily. I found many sources of code online that claim to solve this problem, but the only code I found that was actually giving me some kind of result is the following code in Octave:
[x1, Fs1] = audioread('mixed1.wav');
[x2, Fs2] = audioread('mixed2.wav');
xx = [x1, x2]';
yy = sqrtm(inv(cov(xx')))*(xx-repmat(mean(xx,2),1,size(xx,2)));
[W,s,v] = svd((repmat(sum(yy.*yy,1),size(yy,1),1).*yy)*yy');
a = W*xx;
audiowrite('refined1.wav', a(1,:), Fs1);
audiowrite('refined2.wav', a(2,:), Fs1);
When I say "some kind of result" I mean that it actually outputs working wav files, although it did not separate the two sources very well at all. It basically returned the original mixed files, in lower volume. All other code I could find either did not show how to actually extract the source audio files after processing (example 1), or gave back corrupt WAV files (example 2).
I also converted the corrupt WAV files to MP3 to see if that would let me use them, which it did, but unfortunately I found out it did not separate the 2 audio sources.
I want to be clear, I don't want to take two separate audio sources and mix them artificially and then separate them, as seen in the following example:
I want to actually record 2, or more, mixed audio sources and separate them. Which algorithm to use to implement this? (ICA,PCA,SVD, etc)