OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #define _USE_MATH_DEFINES | 11 #define _USE_MATH_DEFINES |
12 | 12 |
13 #include "webrtc/modules/audio_processing/beamformer/covariance_matrix_generator
.h" | 13 #include "webrtc/modules/audio_processing/beamformer/covariance_matrix_generator
.h" |
14 | 14 |
15 #include <cmath> | 15 #include <cmath> |
16 | 16 |
| 17 #include "webrtc/modules/audio_processing/beamformer/matrix_test_helpers.h" |
17 #include "webrtc/test/gtest.h" | 18 #include "webrtc/test/gtest.h" |
18 #include "webrtc/modules/audio_processing/beamformer/matrix_test_helpers.h" | |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 using std::complex; | 22 using std::complex; |
23 | 23 |
24 TEST(CovarianceMatrixGeneratorTest, TestUniformCovarianceMatrix2Mics) { | 24 TEST(CovarianceMatrixGeneratorTest, TestUniformCovarianceMatrix2Mics) { |
25 const float kWaveNumber = 0.5775f; | 25 const float kWaveNumber = 0.5775f; |
26 const int kNumberMics = 2; | 26 const int kNumberMics = 2; |
27 const float kMicSpacing = 0.05f; | 27 const float kMicSpacing = 0.05f; |
28 const float kTolerance = 0.0001f; | 28 const float kTolerance = 0.0001f; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 EXPECT_NEAR(actual_els[1][2].imag(), 0.1546f, kTolerance); | 221 EXPECT_NEAR(actual_els[1][2].imag(), 0.1546f, kTolerance); |
222 EXPECT_NEAR(actual_els[2][0].imag(), -0.274f, kTolerance); | 222 EXPECT_NEAR(actual_els[2][0].imag(), -0.274f, kTolerance); |
223 EXPECT_NEAR(actual_els[2][1].imag(), -0.1546f, kTolerance); | 223 EXPECT_NEAR(actual_els[2][1].imag(), -0.1546f, kTolerance); |
224 EXPECT_NEAR(actual_els[2][2].imag(), 0.f, kTolerance); | 224 EXPECT_NEAR(actual_els[2][2].imag(), 0.f, kTolerance); |
225 } | 225 } |
226 | 226 |
227 // PhaseAlignmentMasks is tested by AngledCovarianceMatrix and by | 227 // PhaseAlignmentMasks is tested by AngledCovarianceMatrix and by |
228 // InitBeamformerWeights in BeamformerUnittest. | 228 // InitBeamformerWeights in BeamformerUnittest. |
229 | 229 |
230 } // namespace webrtc | 230 } // namespace webrtc |
OLD | NEW |