def UBBM(self):
"""
Computation of Upper Bound Binary Mask. As appears in :
- J.J. Burred, "From Sparse Models to Timbre Learning: New Methods for Musical Source Separation", PhD Thesis,
TU Berlin, 2009.
Args:
sTarget: (2D ndarray) Magnitude Spectrogram of the target component
nResidual: (2D ndarray) Magnitude Spectrogram of the residual component (Should not contain target source!)
Returns:
mask: (2D ndarray) Array that contains time frequency gain values
"""
print('Upper Bound Binary Mask')
mask = 20. * np.log(self._eps + np.divide((self._eps + (self._sTarget ** self._alpha)),
((self._eps + (self._nResidual ** self._alpha)))))
bg = np.where(mask >= 0)
sm = np.where(mask < 0)
mask[bg[0],bg[1]] = 1.
mask[sm[0], sm[1]] = 0.
self._mask = mask
评论列表
文章目录