-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
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()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels