def test_rank1_gev_gev(self): gev_rank1 = get_bf_vector('rank1_gev+gev', self.target_psd, self.noise_psd) assert gev_rank1.shape == self.output_shape, gev_rank1.shape gev_rank1_test_equal = get_bf_vector('rank1_gev+gev', self.target_psd, self.noise_psd) np.testing.assert_equal(gev_rank1, gev_rank1_test_equal) gev = get_bf_vector('gev', self.target_psd, self.noise_psd) np.testing.assert_allclose(np.abs(gev_rank1), np.abs(gev), verbose=True) np.testing.assert_allclose(zero_degree_normalization(gev_rank1, 0), zero_degree_normalization(gev, 0), verbose=True)
def test_rank1_gev_gev(self): gev_rank1 = get_bf_vector('rank1_gev+gev', self.target_psd, self.noise_psd) assert gev_rank1.shape == self.output_shape, gev_rank1.shape gev_rank1_test_equal = get_bf_vector('rank1_gev+gev', self.target_psd, self.noise_psd) # Test if two subsequent identical calls produce same result np.testing.assert_equal(gev_rank1, gev_rank1_test_equal) # Test that all magnitudes are equal gev = get_bf_vector('gev', self.target_psd, self.noise_psd) np.testing.assert_allclose(np.abs(gev_rank1), np.abs(gev), verbose=True) # Test that they are equal when constraining the phases. In other # they are allowed to differ with respect to the phase. np.testing.assert_allclose(zero_degree_normalization(gev_rank1, 0), zero_degree_normalization(gev, 0), verbose=True)
def test_gev_ban_shape(self): bf = 'gev' output = get_bf_vector(f'{bf}+ban', self.target_psd, self.noise_psd) assert output.shape == self.output_shape
def test_gev_shape(self): bf = 'gev' for rank1 in ['rank1_pca', 'rank1_gev']: output = get_bf_vector(f'{rank1}+{bf}', self.target_psd, self.noise_psd) assert output.shape == self.output_shape
def test_mvdr_shape(self): bf = 'mvdr' for atf in ['pca', 'scaled_gev_atf']: output = get_bf_vector(f'{atf}+{bf}', self.target_psd, self.noise_psd) assert output.shape == self.output_shape
def pca_shape(self): output = get_bf_vector(f'pca', self.target_psd, self.noise_psd) assert output.shape == self.output_shape