nussl/separation/spatial/duet.py
def _compute_masks(self):
        """Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source
        separation.

        """
        # compute masks for separation
        best_so_far = np.inf * np.ones_like(self.stft_ch0, dtype=float)

        for i in range(0, self.num_sources):
            mask_array = np.zeros_like(self.stft_ch0, dtype=bool)
            phase = np.exp(-1j * self.frequency_matrix * self.delay_peak[i])
            score = np.abs(self.atn_peak[i] * phase * self.stft_ch0 - self.stft_ch1) ** 2 / (1 + self.atn_peak[i] ** 2)
            mask = (score < best_so_far)
            mask_array[mask] = True
            background_mask = self.mask_type(np.array(mask_array))
            self.result_masks.append(background_mask)
            self.result_masks[0].mask = np.logical_xor(self.result_masks[i].mask, self.result_masks[0].mask)
            best_so_far[mask] = score[mask]

        # Compute first mask based on what the other masks left remaining
        self.result_masks[0].mask = np.logical_not(self.result_masks[0].mask)
        return self.result_masks
Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source
        separation.

        
Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source
separation.
Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source separation .
def _compute_masks(self):
        best_so_far = np.inf * np.ones_like(self.stft_ch0, dtype=float)
        for i in range(0, self.num_sources):
            mask_array = np.zeros_like(self.stft_ch0, dtype=bool)
            phase = np.exp(-1j * self.frequency_matrix * self.delay_peak[i])
            score = np.abs(self.atn_peak[i] * phase * self.stft_ch0 - self.stft_ch1) ** 2 / (1 + self.atn_peak[i] ** 2)
            mask = (score < best_so_far)
            mask_array[mask] = True
            background_mask = self.mask_type(np.array(mask_array))
            self.result_masks.append(background_mask)
            self.result_masks[0].mask = np.logical_xor(self.result_masks[i].mask, self.result_masks[0].mask)
            best_so_far[mask] = score[mask]
        self.result_masks[0].mask = np.logical_not(self.result_masks[0].mask)
        return self.result_masks
def _compute_masks ( self ) : best_so_far = np . inf * np . ones_like ( self . stft_ch0 , dtype = float ) for i in range ( 0 , self . num_sources ) : mask_array = np . zeros_like ( self . stft_ch0 , dtype = bool ) phase = np . exp ( - 1j * self . frequency_matrix * self . delay_peak [ i ] ) score = np . abs ( self . atn_peak [ i ] * phase * self . stft_ch0 - self . stft_ch1 ) ** 2 / ( 1 + self . atn_peak [ i ] ** 2 ) mask = ( score < best_so_far ) mask_array [ mask ] = True background_mask = self . mask_type ( np . array ( mask_array ) ) self . result_masks . append ( background_mask ) self . result_masks [ 0 ] . mask = np . logical_xor ( self . result_masks [ i ] . mask , self . result_masks [ 0 ] . mask ) best_so_far [ mask ] = score [ mask ] self . result_masks [ 0 ] . mask = np . logical_not ( self . result_masks [ 0 ] . mask ) return self . result_masks
Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source
separation.
Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source separation .
"""Receives the attenuation and delay peaks and computes a mask to be applied to the signal for source
        separation.

        """ # compute masks for separation # Compute first mask based on what the other masks left remaining
self