Skip to content

Instantly share code, notes, and snippets.

@alculquicondor
Created March 27, 2012 02:51
Show Gist options
  • Save alculquicondor/2212064 to your computer and use it in GitHub Desktop.
Save alculquicondor/2212064 to your computer and use it in GitHub Desktop.
Cocktail Party Problem
dir = strcat(pwd, "/");
f1 = strcat(dir, input("audio 1: ","s"));
f2 = strcat(dir, input("audio 2: ","s"));
[y, FS, BPS] = wavread(f1);
[z, FS, BPS] = wavread(f2);
FS
%y = lin2mu(y(1:400000),0);
%z = lin2mu(z(1:400000),0);
y = lin2mu(y(1001:50000),0);
z = lin2mu(z(1001:50000),0);
x = [y, z];
t = repmat(sum(x.*x,1),size(x,1),1).*x;
[W,s,v] = svd(t*x');
x = W*x;
y = x(:, 1);
z = x(:, 2);
y = mu2lin(y,0);
z = mu2lin(z,0);
wavwrite(y, FS, BPS, "salida1.wav");
wavwrite(z, FS, BPS, "salida2.wav")
@saurabhshahpur
Copy link

can you explain the code ASAP

@Guojin118
Copy link

It will cause out of memory issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment