Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpca_example outputs wav file identical to input #3

Open
Dingdong8187 opened this issue Aug 8, 2017 · 2 comments
Open

rpca_example outputs wav file identical to input #3

Dingdong8187 opened this issue Aug 8, 2017 · 2 comments

Comments

@Dingdong8187
Copy link

Dingdong8187 commented Aug 8, 2017

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()
@deeuu deeuu mentioned this issue Aug 22, 2017
@deeuu
Copy link
Collaborator

deeuu commented Aug 22, 2017

Hi,

Unless @g-roma can help, I'll try to look at this when I have more time, which will be in a few weeks time.

Thanks

@deeuu
Copy link
Collaborator

deeuu commented Dec 20, 2017

Perhaps the revised example makes more sense now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants