def test_covariance_with_mask_independent_dim(self): x = rand(2, 3, 4, data_type=np.complex128) mask = np.random.uniform(0, 1, ( 2, 4, )) psd = get_power_spectral_density_matrix(x, mask) tc.assert_equal(psd.shape, (2, 3, 3)) assert_positive_semidefinite(psd)
def generate_and_verify_psd(self, x_shape, mask_shape, psd_shape=None): x, mask = self.generate_date(x_shape, mask_shape) if mask_shape is None: psd = get_power_spectral_density_matrix(x) else: psd = get_power_spectral_density_matrix(x, mask) if psd_shape is not None: tc.assert_equal(psd.shape, psd_shape) assert_hermitian(psd) assert_positive_semidefinite(psd)
def test_multiple_sources_for_source_separation(self): x = rand(2, 3, 4, data_type=np.complex128) mask = np.random.uniform(0, 1, ( 5, 2, 4, )) psd = get_power_spectral_density_matrix(x[np.newaxis, ...], mask) tc.assert_equal(psd.shape, (5, 2, 3, 3)) assert_positive_semidefinite(psd)
def test_covariance_without_mask_independent_dim(self): x = rand(1, 2, 3, 4, data_type=np.complex128) psd = get_power_spectral_density_matrix(x) tc.assert_equal(psd.shape, (1, 2, 3, 3)) assert_positive_semidefinite(psd)