Пример #1
0
    def test_correlations_narrow_v1_vs_v6(self):
        inverse_power = wpe.get_power_inverse(self.Y)
        R_desired, r_desired = wpe.get_correlations_narrow(
            self.Y, inverse_power, self.K, self.delay)

        s = [Ellipsis, slice(self.delay + self.K - 1, None)]
        Y_tilde = wpe.build_y_tilde(self.Y, self.K, self.delay)
        R_actual, r_actual = wpe.get_correlations_v6(self.Y[s], Y_tilde[s],
                                                     inverse_power[s])
        tc.assert_allclose(R_actual.conj(), R_desired)
        tc.assert_allclose(r_actual.conj(),
                           np.swapaxes(r_desired, 1,
                                       2).reshape(-1, r_desired.shape[-1]),
                           rtol=1e-5,
                           atol=1e-5)
Пример #2
0
    def test_filter_matrix_conj_v1_vs_v7(self):
        inverse_power = wpe.get_power_inverse(self.Y)

        correlation_matrix, correlation_vector = wpe.get_correlations(
            self.Y, inverse_power, self.K, self.delay)
        desired = wpe.get_filter_matrix_conj(correlation_matrix,
                                             correlation_vector, self.K,
                                             self.D)

        s = [Ellipsis, slice(self.delay + self.K - 1, None)]
        Y_tilde = wpe.build_y_tilde(self.Y, self.K, self.delay)
        actual = wpe.get_filter_matrix_v7(
            self.Y,
            Y_tilde=Y_tilde,
            inverse_power=inverse_power,
        )
        tc.assert_allclose(actual.conj(),
                           np.swapaxes(desired, 1,
                                       2).reshape(-1, desired.shape[-1]),
                           atol=1e-10)