OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" | 11 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 #include <array> | 14 #include <array> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/array_view.h" | |
18 #include "webrtc/base/random.h" | |
19 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" | 17 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
20 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" | 18 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" |
21 #include "webrtc/modules/audio_processing/aec3/fft_data.h" | 19 #include "webrtc/modules/audio_processing/aec3/fft_data.h" |
22 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" | 20 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" |
23 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" | 21 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" |
| 22 #include "webrtc/rtc_base/array_view.h" |
| 23 #include "webrtc/rtc_base/random.h" |
24 #include "webrtc/test/gtest.h" | 24 #include "webrtc/test/gtest.h" |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 namespace { | 27 namespace { |
28 | 28 |
29 constexpr float kPi = 3.141592f; | 29 constexpr float kPi = 3.141592f; |
30 | 30 |
31 void ProduceSinusoid(int sample_rate_hz, | 31 void ProduceSinusoid(int sample_rate_hz, |
32 float sinusoidal_frequency_hz, | 32 float sinusoidal_frequency_hz, |
33 size_t* sample_counter, | 33 size_t* sample_counter, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Verify that no bands are detected as narrow when the delay is unknown. | 114 // Verify that no bands are detected as narrow when the delay is unknown. |
115 generate_sinusoid_test(false); | 115 generate_sinusoid_test(false); |
116 mask.fill(1.f); | 116 mask.fill(1.f); |
117 analyzer.MaskRegionsAroundNarrowBands(&mask); | 117 analyzer.MaskRegionsAroundNarrowBands(&mask); |
118 std::for_each(mask.begin(), mask.end(), [](float a) { EXPECT_EQ(1.f, a); }); | 118 std::for_each(mask.begin(), mask.end(), [](float a) { EXPECT_EQ(1.f, a); }); |
119 EXPECT_FALSE(analyzer.PoorSignalExcitation()); | 119 EXPECT_FALSE(analyzer.PoorSignalExcitation()); |
120 } | 120 } |
121 | 121 |
122 } // namespace webrtc | 122 } // namespace webrtc |
OLD | NEW |