Giter Site home page Giter Site logo

untwist's People

Contributors

deeuu avatar g-roma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

untwist's Issues

Error/type-o in mlp_examples.py

In the following block of code found in file mlp_examples.py, lines 38-40
Xtrain = X[:,train_frames:].magnitude().T
Xtest = ds.standardize_points(Xtest)
pred = sgd.predict(Xtest)

I believe there is a typo-o, where in the middle code line above, Xtest is used before it is defined.
It seems to me that it is actually a type-o, and that the 2nd line of code should pass in Xtrain instead.

So the corrected lines of code would look like this
Xtrain = X[:,train_frames:].magnitude().T
Xtest = ds.standardize_points(Xtrain)
pred = sgd.predict(Xtest)

"rpca.process" is not working on multiple files

audio_path = '/Users/kwang/Desktop/untwist-master/dataset/chuncks_gj'
save_path = '/Users/kwang/Desktop/untwist-master/result/rpca'

files = [y for y in os.listdir(audio_path) if '.wav' in y]
files[0] # result  'jxscsgTyGB410.wav'

for i in files:
    x = Wave.read(audio_path + '/' + i)
    X = stft.process(x)    
    (L, S) = rpca.process(X.magnitude()) # issue is happened!
    M = RatioMask(np.abs(S), np.abs(L))
    v = istft.process(X * M)
    v.write(os.path.join(save_path, i))

ArpackNoConvergence Traceback (most recent call last)
in
2 x = Wave.read(audio_path + '/' + i)
3 X = stft.process(x)
----> 4 (L, S) = rpca.process(X.magnitude())
5 M = RatioMask(np.abs(S), np.abs(L))
6 v = istft.process(X * M)

~/Desktop/untwist-master/untwist/factorizations/rpca.py in process(self, X)
56 sparse_svd = self.choosvd( n, sv)
57 if sparse_svd:
---> 58 U, S, V = svds(X - E + (1 / mu) * Y, sv, which= "LM")
59 else:
60 U, S, V = svd(X - E + (1 / mu) * Y, full_matrices = False)

/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in svds(A, k, ncv, tol, which, v0, maxiter, return_singular_vectors)
1808 # This is not a stable way to approach the problem.
1809 eigvals, eigvec = eigsh(XH_X, k=k, tol=tol ** 2, maxiter=maxiter,
-> 1810 ncv=ncv, which=which, v0=v0)
1811
1812 # In 'LM' mode try to be clever about small eigenvalues.

/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in eigsh(A, k, M, sigma, which, v0, ncv, maxiter, tol, return_eigenvectors, Minv, OPinv, mode)
1649 with _ARPACK_LOCK:
1650 while not params.converged:
-> 1651 params.iterate()
1652
1653 return params.extract(return_eigenvectors)

/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in iterate(self)
568 pass
569 elif self.info == 1:
--> 570 self._raise_no_convergence()
571 else:
572 raise ArpackError(self.info, infodict=self.iterate_infodict)

/anaconda3/lib/python3.6/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py in _raise_no_convergence(self)
374 vec = np.zeros((self.n, 0))
375 k_ok = 0
--> 376 raise ArpackNoConvergence(msg % (num_iter, k_ok, self.k), ev, vec)
377
378

ArpackNoConvergence: ARPACK error -1: No convergence (5131 iterations, 0/1 eigenvectors converged)

RPCA Query

Hi,
Is the given RPCA code able to do single source separation ?
If so, then how is it performing this task?
All it gives as a result is the estimated vocal result which is almost identical to the input?
How can this code be used for separation of singing voices.

rpca_example outputs wav file identical to input

Running the following code produces a vocal_estimate.wav file that includes the background music as well.


import numpy as np
import matplotlib.pyplot as plt
from untwist.data import Wave, RatioMask
from untwist.transforms import STFT, ISTFT
from untwist.factorizations import RPCA

stft = STFT()
istft = ISTFT()
rpca = RPCA(iterations = 100)

x = Wave.read("/home/usama/mix5.wav")
X = stft.process(x[:,0])

(L,S) = rpca.process(X.magnitude())

M = RatioMask(S, L)
v = istft.process(X * M)
v.write("vocal_estimate.wav")

plt.subplot(4,1,1)
X.plot(label_x = False, title = "mixture")
plt.subplot(4,1,2)
L.plot(label_x = False, title = "L")
plt.subplot(4,1,3)
S.plot(label_x = False, title = "S")
plt.subplot(4,1,4)
M.plot(title="estimated mask")
plt.show()

RPCA should return Spectrograms

Greetings,

I am trying to follow your rpca_example.py and at
M = RatioMask(np.abs(S),np.abs(L))
or
M = RatioMask(S,L)

I get:

421     def __new__(cls, target, background, p = 1):
422         tm = target.magnitude() + eps

--> 423 bm = background.magnitude() + eps
424 mask = (tm**p / (tm + bm)**p).astype(types.float)
425 instance = TFMask.new(cls, mask)

AttributeError: 'numpy.ndarray' object has no attribute 'magnitude'

Installed untwist via conda, on MacOS Sierra 10.12.4.
The error above I do not get, since the previous line
(L,S) = rpca.process(X.magnitude())
run fine?

Any help is greatly appreciated

How to use this API ?

I am unable to understand from documentation. Can someone send me whole project implementation ....

FFT size > window size

At present, stft does not allow for zero-padding, i.e. the size of the analysis window is fixed to fft_size.

Goal: Allow for (preferably zero-phase) zero-padding of the windowed data.

Processing with stereo format

Hi,

I would like to test mlp_example with stereo files.
Do you have some mlp_example for stereo format?

Thanks a lot,
XL

Scipy/Io/wavfile error when using untwist.data Wave?

I'm trying to run your RPCA example and I'm getting the following error after
x = Wave.read("mix3.wav")`

/Users/mact/anaconda/envs/bss/lib/python3.6/site-packages/scipy/io/wavfile.py:273: WavFileWarning: Chunk (non-data) not understood, skipping it.
  WavFileWarning)

Can you help me finding the error? (environment, type of wav, other)
Thx in advance

The (theano) segment will crash when running on GPU due to float64

You likely already know this, but within the CUDA 7.5 framework for the GPU (specifically cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb, and theano 0.9.0rc2 ), the call to pred = sgd.predict(Xtest) will crash due to float64 being typecasted to float32.

I am not sure exactly why only on that specifically call to sgd.predict(), since an eariler call sgd.train(ds) does not crash.

That said, fix is simple:
Code block mlp_examples.py before the fix:

Xtrain = X[:,train_frames:].magnitude().T
Xtest = ds.standardize_points(Xtest)
pred = sgd.predict(Xtest)

Code block after the fix:

Xtrain = (X[:,train_frames:].magnitude().T).astype(np.float32)
Xtest = ds.standardize_points(Xtest)
pred = sgd.predict(Xtest)

float64 and complex128 are also mentioned elsewhere in the code (types.py and qerbt.py), but I think the simple above chage fixes the problem (as changing the rest did not make a differance for me).

The command line to run on the GPU was:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python -u -i mlp_example.py

FYI that if floatX=float64, then, the execution will on the CPU only.

MLP Issue

Hi.
I am trying to run the mlp example of the untwist toolbox.
I am getting this error "ValueError: operands could not be broadcast together with shapes (441000,) (110250,) "
I have used the trim cmmd of sox to make both the audio files of same sizes.
screenshot from 2017-08-09 14-29-05

Cannot instantiate LowPass filter

filters.LowPass(100, sample_rate=44100) yields

Traceback (most recent call last):
  File "test_measure.py", line 21, in <module>
    est_vox = filters.LowPass(100, sample_rate=44100)
  File "/home/dominic/git/perceptual-study-source-separation/venvs/env/lib/python3.6/site-packages/untwist-0.1.dev1-py3.6-linux-x86_64.egg/untwist/filters/biquad.py", line 34, in __init__
    super(LowPass, self).__init__(sample_rate)
  File "/home/dominic/git/perceptual-study-source-separation/venvs/env/lib/python3.6/site-packages/untwist-0.1.dev1-py3.6-linux-x86_64.egg/untwist/filters/biquad.py", line 9, in __init__
    super(Biquad, self).__init__(np.zeros((1, 3)), self.sample_rate)
AttributeError: 'LowPass' object has no attribute 'sample_rate'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.