1

using this sound file: http://www.ism.ac.jp/~shiro/research/sounds/RSM/X_rsm2.wav

I'm trying to recreate Andrew Ng's Machine Learning presentation(https://class.coursera.org/ml-005/lecture) from coursera in matlab

What I do is to read a .wav file (16khz, 7 sec, 2 channels)

[x,xfs] = wavread('track.wav')

Now I transpose x

x = x'

Now I proceed to use x on the cocktail party algorithm

[W,s,v] = svd((repmat(sum(x.*x,1),size(x,1),1).*x)*x')

MATLAB returns:

W =

   -0.9233   -0.3841
   -0.3841    0.9233


s =

  265.4832         0
         0   13.0768


v =

   -0.9233   -0.3841
   -0.3841    0.9233

Where is the separated audio?

EDIT: From further research, I found out that W is only the unmixing matrix. Meaning this algo is incomplete if my goal is to get the two output separated sound sources. What do I do with this unmixing matrix?

Shonos
  • 11
  • 3

2 Answers2

1

I believe you want to apply the unmixing matrix W you found through SVD to the mixed signals x. This can be done simply as follows:

sigs = W*x;

Now sigs(1,:) will be one of the separated signals and sigs(2,:) will be the other.

Good luck.

CatsLoveJazz
  • 829
  • 1
  • 16
  • 35
0

I believe you're running out of memory because you're trying to repmat across the wrong dimension (or possibly your x variable needs to be transposed). Loading x as you have gives you a variable of size:

>> size(x) = [110000, 2]

Of course, if you try to repmat this as you have, you're essentially telling MATLAB to:

repmat(x,110000,1);

If you do the math, you're trying to create a variable of size [12100000000, 2]. That's 12 billion if you can't be bothered counting the zeros. A single double value in MATLAB is 8 bytes in size, so you're trying to create a variable that would use 12100000000*8*2 bytes = ~200 GB. Chances are you don't have this much memory, hence why MATLAB isn't letting you.

Long story short, try transposing x before repmatting it.

MrAzzaman
  • 4,734
  • 12
  • 25
  • Now, before I plug-in x to the algorithm, I transpose it first just as you said. I no longer get the Out of Memory error! But I'm confused with the results of W,s,v. They only have a size of 2x2. Shouldn't they be the separated audio? – Shonos Sep 24 '14 at 05:38
  • Perhaps try transposing the result of the `repmat`? – MrAzzaman Sep 24 '14 at 05:47
  • ACtually it wasn't the function svd, it was multiplying matrices that cannot be multiplied because of their size. – Shonos Sep 24 '14 at 07:20