3

I have a question with regards to this post: cocktail party algorithm SVD implementation ... in one line of code?

I realize there are similar questions to this. However, please note that my particular question takes things in a new direction, inasmuch that I'm looking for a purely Python equivalent. Is this procedure as elegant/simple when written in Python 3.5 (as opposed to the original Octave 'one line of code')? Also include any relevant Python libraries for this kind of application. Of course, if it turns out that Python is not equipped for this kind of application at all, please explain why.

I'm just seeking some expert opinions about what it might look like and/or the feasibility in Python 3.5 only.

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58
Arash Howaida
  • 2,575
  • 2
  • 19
  • 50

1 Answers1

3

How about using numpy? Using this guide I translated the statement to

from numpy import *
U, S, Vh = linalg.svd(dot((tile(sum(x*x,0),(x.shape[0],1))*x),x.T))

It runs but I do not have any data to actually test it.

Ken Williams
  • 22,756
  • 10
  • 85
  • 147
sietschie
  • 7,425
  • 3
  • 33
  • 54
  • I will try it out too. Thank's for chipping in! Here is a link with example audio files: http://research.ics.aalto.fi/ica/cocktail/cocktail_en.cgi – Arash Howaida Sep 13 '16 at 11:21
  • I dont know why, but my browser won't let me look at your link. Can you explain the notation a little? I'm guessing U is audio from Mic 1, S, is audio from mic 2, and vh is one of the separated audio sources? – Arash Howaida Sep 13 '16 at 15:32
  • I fixed the link. The answers to the original question you posted explain how to use this code. – sietschie Sep 13 '16 at 20:18
  • Updated link for everyone: https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html – Edeki Okoh Jul 26 '19 at 18:26