masking_methods.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:mss_pytorch 作者: Js-Mim 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号