Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: webrtc/modules/audio_processing/low_cut_filter_unittest.cc

Issue 2415403002: Introduced the new parameter setting scheme for activating the high-pass filter in APM (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 #include <vector> 10 #include <vector>
11 11
12 #include "webrtc/base/array_view.h" 12 #include "webrtc/base/array_view.h"
13 #include "webrtc/modules/audio_processing/audio_buffer.h" 13 #include "webrtc/modules/audio_processing/audio_buffer.h"
14 #include "webrtc/modules/audio_processing/high_pass_filter_impl.h" 14 #include "webrtc/modules/audio_processing/low_cut_filter.h"
15 #include "webrtc/modules/audio_processing/test/audio_buffer_tools.h" 15 #include "webrtc/modules/audio_processing/test/audio_buffer_tools.h"
16 #include "webrtc/modules/audio_processing/test/bitexactness_tools.h" 16 #include "webrtc/modules/audio_processing/test/bitexactness_tools.h"
17 #include "webrtc/test/gtest.h" 17 #include "webrtc/test/gtest.h"
18 18
19 namespace webrtc { 19 namespace webrtc {
20 namespace { 20 namespace {
21 21
22 // Process one frame of data and produce the output. 22 // Process one frame of data and produce the output.
23 std::vector<float> ProcessOneFrame(const std::vector<float>& frame_input, 23 std::vector<float> ProcessOneFrame(const std::vector<float>& frame_input,
24 const StreamConfig& stream_config, 24 const StreamConfig& stream_config,
25 HighPassFilterImpl* high_pass_filter) { 25 LowCutFilter* low_cut_filter) {
26 AudioBuffer audio_buffer( 26 AudioBuffer audio_buffer(
27 stream_config.num_frames(), stream_config.num_channels(), 27 stream_config.num_frames(), stream_config.num_channels(),
28 stream_config.num_frames(), stream_config.num_channels(), 28 stream_config.num_frames(), stream_config.num_channels(),
29 stream_config.num_frames()); 29 stream_config.num_frames());
30 30
31 test::CopyVectorToAudioBuffer(stream_config, frame_input, &audio_buffer); 31 test::CopyVectorToAudioBuffer(stream_config, frame_input, &audio_buffer);
32 high_pass_filter->ProcessCaptureAudio(&audio_buffer); 32 low_cut_filter->Process(&audio_buffer);
33 std::vector<float> frame_output; 33 std::vector<float> frame_output;
34 test::ExtractVectorFromAudioBuffer(stream_config, &audio_buffer, 34 test::ExtractVectorFromAudioBuffer(stream_config, &audio_buffer,
35 &frame_output); 35 &frame_output);
36 return frame_output; 36 return frame_output;
37 } 37 }
38 38
39 // Processes a specified amount of frames, verifies the results and reports 39 // Processes a specified amount of frames, verifies the results and reports
40 // any errors. 40 // any errors.
41 void RunBitexactnessTest(int sample_rate, 41 void RunBitexactnessTest(int sample_rate,
42 int num_channels, 42 int num_channels,
43 const std::vector<float>& input, 43 const std::vector<float>& input,
44 const std::vector<float>& reference) { 44 const std::vector<float>& reference) {
45 const StreamConfig stream_config(sample_rate, num_channels, false); 45 const StreamConfig stream_config(sample_rate, num_channels, false);
46 rtc::CriticalSection crit; 46 LowCutFilter low_cut_filter(num_channels, sample_rate);
47 HighPassFilterImpl high_pass_filter(&crit);
48
49 high_pass_filter.Initialize(num_channels, sample_rate);
50 high_pass_filter.Enable(true);
51 47
52 std::vector<float> output; 48 std::vector<float> output;
53 const size_t num_frames_to_process = 49 const size_t num_frames_to_process =
54 input.size() / 50 input.size() /
55 (stream_config.num_frames() * stream_config.num_channels()); 51 (stream_config.num_frames() * stream_config.num_channels());
56 for (size_t frame_no = 0; frame_no < num_frames_to_process; ++frame_no) { 52 for (size_t frame_no = 0; frame_no < num_frames_to_process; ++frame_no) {
57 std::vector<float> frame_input( 53 std::vector<float> frame_input(
58 input.begin() + 54 input.begin() +
59 stream_config.num_frames() * stream_config.num_channels() * 55 stream_config.num_frames() * stream_config.num_channels() *
60 frame_no, 56 frame_no,
61 input.begin() + 57 input.begin() +
62 stream_config.num_frames() * stream_config.num_channels() * 58 stream_config.num_frames() * stream_config.num_channels() *
63 (frame_no + 1)); 59 (frame_no + 1));
64 60
65 output = ProcessOneFrame(frame_input, stream_config, &high_pass_filter); 61 output = ProcessOneFrame(frame_input, stream_config, &low_cut_filter);
66 } 62 }
67 63
68 // Form vector to compare the reference to. Only the last frame processed 64 // Form vector to compare the reference to. Only the last frame processed
69 // is compared in order not having to specify all preceeding frames as 65 // is compared in order not having to specify all preceeding frames as
70 // inputs. As the algorithm being tested has a memory, testing only 66 // inputs. As the algorithm being tested has a memory, testing only
71 // the last frame implicitly also tests the preceeding frames. 67 // the last frame implicitly also tests the preceeding frames.
72 const size_t reference_frame_length = 68 const size_t reference_frame_length =
73 reference.size() / stream_config.num_channels(); 69 reference.size() / stream_config.num_channels();
74 std::vector<float> output_to_verify; 70 std::vector<float> output_to_verify;
75 for (size_t channel_no = 0; channel_no < stream_config.num_channels(); 71 for (size_t channel_no = 0; channel_no < stream_config.num_channels();
(...skipping 15 matching lines...) Expand all
91 // TODO(peah): Remove once braced initialization is allowed. 87 // TODO(peah): Remove once braced initialization is allowed.
92 std::vector<float> CreateVector(const rtc::ArrayView<const float>& array_view) { 88 std::vector<float> CreateVector(const rtc::ArrayView<const float>& array_view) {
93 std::vector<float> v; 89 std::vector<float> v;
94 for (auto value : array_view) { 90 for (auto value : array_view) {
95 v.push_back(value); 91 v.push_back(value);
96 } 92 }
97 return v; 93 return v;
98 } 94 }
99 } // namespace 95 } // namespace
100 96
101 TEST(HighPassFilterBitExactnessTest, Mono8kHzInitial) { 97 TEST(LowCutFilterBitExactnessTest, Mono8kHzInitial) {
102 const float kReferenceInput[] = { 98 const float kReferenceInput[] = {
103 0.153442f, -0.436920f, -0.057602f, -0.141767f, 0.108608f, 0.116834f, 99 0.153442f, -0.436920f, -0.057602f, -0.141767f, 0.108608f, 0.116834f,
104 0.114979f, -0.103151f, -0.169925f, -0.167180f, 0.242024f, -0.525426f, 100 0.114979f, -0.103151f, -0.169925f, -0.167180f, 0.242024f, -0.525426f,
105 -0.058781f, 0.076667f, -0.185095f, 0.135319f, -0.020223f, -0.266058f, 101 -0.058781f, 0.076667f, -0.185095f, 0.135319f, -0.020223f, -0.266058f,
106 0.045755f, -0.076044f, -0.116221f, -0.201698f, 0.017423f, -0.523475f, 102 0.045755f, -0.076044f, -0.116221f, -0.201698f, 0.017423f, -0.523475f,
107 -0.112949f, -0.154125f, -0.258572f, 0.185075f, -0.208205f, 0.153298f, 103 -0.112949f, -0.154125f, -0.258572f, 0.185075f, -0.208205f, 0.153298f,
108 0.276703f, -0.044481f, 0.078771f, 0.181337f, -0.022962f, 0.153365f, 104 0.276703f, -0.044481f, 0.078771f, 0.181337f, -0.022962f, 0.153365f,
109 -0.358004f, 0.314864f, -0.280593f, -0.518572f, 0.392579f, -0.017786f, 105 -0.358004f, 0.314864f, -0.280593f, -0.518572f, 0.392579f, -0.017786f,
110 0.127293f, -0.103003f, -0.289389f, -0.871355f, 0.177583f, -0.081290f, 106 0.127293f, -0.103003f, -0.289389f, -0.871355f, 0.177583f, -0.081290f,
111 -0.055957f, 0.115011f, -0.402460f, -0.206836f, 0.325328f, 0.169526f, 107 -0.055957f, 0.115011f, -0.402460f, -0.206836f, 0.325328f, 0.169526f,
112 -0.363311f, -0.624742f, -0.161979f, 0.060679f, 0.267214f, 0.026576f, 108 -0.363311f, -0.624742f, -0.161979f, 0.060679f, 0.267214f, 0.026576f,
113 -0.318235f, 0.086812f, -0.332419f, -0.272485f, -0.185369f, -0.348598f, 109 -0.318235f, 0.086812f, -0.332419f, -0.272485f, -0.185369f, -0.348598f,
114 -0.076833f, -0.255184f, -0.081007f, -0.131121f, -0.116196f, -0.142780f, 110 -0.076833f, -0.255184f, -0.081007f, -0.131121f, -0.116196f, -0.142780f,
115 0.349705f, 0.173054f, 0.016750f, -0.415957f, -0.461001f, -0.557111f, 111 0.349705f, 0.173054f, 0.016750f, -0.415957f, -0.461001f, -0.557111f,
116 0.738711f, 0.275720f}; 112 0.738711f, 0.275720f};
117 113
118 const float kReference[] = {0.142277f, -0.418518f, -0.028229f, -0.102112f, 114 const float kReference[] = {0.142277f, -0.418518f, -0.028229f, -0.102112f,
119 0.141270f, 0.137791f, 0.124577f, -0.088715f, 115 0.141270f, 0.137791f, 0.124577f, -0.088715f,
120 -0.142273f, -0.125885f, 0.266640f, -0.468079f}; 116 -0.142273f, -0.125885f, 0.266640f, -0.468079f};
121 117
122 RunBitexactnessTest( 118 RunBitexactnessTest(
123 8000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 119 8000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
124 CreateVector(rtc::ArrayView<const float>(kReference))); 120 CreateVector(rtc::ArrayView<const float>(kReference)));
125 } 121 }
126 122
127 TEST(HighPassFilterBitExactnessTest, Mono8kHzConverged) { 123 TEST(LowCutFilterBitExactnessTest, Mono8kHzConverged) {
128 const float kReferenceInput[] = { 124 const float kReferenceInput[] = {
129 0.153442f, -0.436920f, -0.057602f, -0.141767f, 0.108608f, 0.116834f, 125 0.153442f, -0.436920f, -0.057602f, -0.141767f, 0.108608f, 0.116834f,
130 0.114979f, -0.103151f, -0.169925f, -0.167180f, 0.242024f, -0.525426f, 126 0.114979f, -0.103151f, -0.169925f, -0.167180f, 0.242024f, -0.525426f,
131 -0.058781f, 0.076667f, -0.185095f, 0.135319f, -0.020223f, -0.266058f, 127 -0.058781f, 0.076667f, -0.185095f, 0.135319f, -0.020223f, -0.266058f,
132 0.045755f, -0.076044f, -0.116221f, -0.201698f, 0.017423f, -0.523475f, 128 0.045755f, -0.076044f, -0.116221f, -0.201698f, 0.017423f, -0.523475f,
133 -0.112949f, -0.154125f, -0.258572f, 0.185075f, -0.208205f, 0.153298f, 129 -0.112949f, -0.154125f, -0.258572f, 0.185075f, -0.208205f, 0.153298f,
134 0.276703f, -0.044481f, 0.078771f, 0.181337f, -0.022962f, 0.153365f, 130 0.276703f, -0.044481f, 0.078771f, 0.181337f, -0.022962f, 0.153365f,
135 -0.358004f, 0.314864f, -0.280593f, -0.518572f, 0.392579f, -0.017786f, 131 -0.358004f, 0.314864f, -0.280593f, -0.518572f, 0.392579f, -0.017786f,
136 0.127293f, -0.103003f, -0.289389f, -0.871355f, 0.177583f, -0.081290f, 132 0.127293f, -0.103003f, -0.289389f, -0.871355f, 0.177583f, -0.081290f,
137 -0.055957f, 0.115011f, -0.402460f, -0.206836f, 0.325328f, 0.169526f, 133 -0.055957f, 0.115011f, -0.402460f, -0.206836f, 0.325328f, 0.169526f,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 165
170 const float kReference[] = {-0.173553f, -0.265778f, 0.158757f, -0.259399f, 166 const float kReference[] = {-0.173553f, -0.265778f, 0.158757f, -0.259399f,
171 -0.176361f, 0.192877f, 0.056825f, 0.171453f, 167 -0.176361f, 0.192877f, 0.056825f, 0.171453f,
172 0.050752f, -0.194580f, -0.208679f, 0.153722f}; 168 0.050752f, -0.194580f, -0.208679f, 0.153722f};
173 169
174 RunBitexactnessTest( 170 RunBitexactnessTest(
175 8000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 171 8000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
176 CreateVector(rtc::ArrayView<const float>(kReference))); 172 CreateVector(rtc::ArrayView<const float>(kReference)));
177 } 173 }
178 174
179 TEST(HighPassFilterBitExactnessTest, Stereo8kHzInitial) { 175 TEST(LowCutFilterBitExactnessTest, Stereo8kHzInitial) {
180 const float kReferenceInput[] = { 176 const float kReferenceInput[] = {
181 0.790847f, 0.165037f, 0.165494f, 0.709852f, -0.930269f, 0.770840f, 177 0.790847f, 0.165037f, 0.165494f, 0.709852f, -0.930269f, 0.770840f,
182 -0.184538f, -0.927236f, 0.492296f, -0.690342f, -0.712183f, 0.211918f, 178 -0.184538f, -0.927236f, 0.492296f, -0.690342f, -0.712183f, 0.211918f,
183 -0.491038f, -0.351692f, -0.196418f, -0.187253f, -0.227618f, 0.219604f, 179 -0.491038f, -0.351692f, -0.196418f, -0.187253f, -0.227618f, 0.219604f,
184 -0.666219f, -0.623816f, -0.810742f, -0.353627f, 0.539194f, -0.531764f, 180 -0.666219f, -0.623816f, -0.810742f, -0.353627f, 0.539194f, -0.531764f,
185 0.480731f, 0.385637f, 0.648156f, 0.655955f, -0.413264f, -0.381262f, 181 0.480731f, 0.385637f, 0.648156f, 0.655955f, -0.413264f, -0.381262f,
186 0.046060f, -0.349402f, 0.663685f, 0.620590f, 0.113997f, -0.474072f, 182 0.046060f, -0.349402f, 0.663685f, 0.620590f, 0.113997f, -0.474072f,
187 0.361132f, -0.532694f, -0.087149f, -0.230866f, 0.077203f, 0.983407f, 183 0.361132f, -0.532694f, -0.087149f, -0.230866f, 0.077203f, 0.983407f,
188 0.510441f, 0.960910f, -0.530435f, 0.057118f, -0.897128f, 0.513751f, 184 0.510441f, 0.960910f, -0.530435f, 0.057118f, -0.897128f, 0.513751f,
189 0.203960f, 0.714337f, 0.976554f, 0.858969f, -0.180970f, -0.999317f, 185 0.203960f, 0.714337f, 0.976554f, 0.858969f, -0.180970f, -0.999317f,
(...skipping 20 matching lines...) Expand all
210 0.733329f, 0.084109f, 0.072695f, 0.566210f, -1.000000f, 0.652120f, 206 0.733329f, 0.084109f, 0.072695f, 0.566210f, -1.000000f, 0.652120f,
211 -0.297424f, -0.964020f, 0.438551f, -0.698364f, -0.654449f, 0.266243f, 207 -0.297424f, -0.964020f, 0.438551f, -0.698364f, -0.654449f, 0.266243f,
212 0.454115f, 0.684774f, -0.586823f, -0.747345f, -0.503021f, -0.222961f, 208 0.454115f, 0.684774f, -0.586823f, -0.747345f, -0.503021f, -0.222961f,
213 -0.314972f, 0.907224f, -0.796265f, 0.284280f, -0.533417f, 0.773980f}; 209 -0.314972f, 0.907224f, -0.796265f, 0.284280f, -0.533417f, 0.773980f};
214 210
215 RunBitexactnessTest( 211 RunBitexactnessTest(
216 8000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 212 8000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
217 CreateVector(rtc::ArrayView<const float>(kReference))); 213 CreateVector(rtc::ArrayView<const float>(kReference)));
218 } 214 }
219 215
220 TEST(HighPassFilterBitExactnessTest, Stereo8kHzConverged) { 216 TEST(LowCutFilterBitExactnessTest, Stereo8kHzConverged) {
221 const float kReferenceInput[] = { 217 const float kReferenceInput[] = {
222 -0.502095f, -0.227154f, -0.137133f, 0.661773f, 0.649294f, -0.094003f, 218 -0.502095f, -0.227154f, -0.137133f, 0.661773f, 0.649294f, -0.094003f,
223 -0.238880f, 0.851737f, 0.481687f, 0.475266f, 0.893832f, 0.020199f, 219 -0.238880f, 0.851737f, 0.481687f, 0.475266f, 0.893832f, 0.020199f,
224 0.583758f, -0.095653f, 0.698397f, -0.219138f, 0.476753f, 0.952877f, 220 0.583758f, -0.095653f, 0.698397f, -0.219138f, 0.476753f, 0.952877f,
225 0.046598f, -0.140169f, -0.585684f, -0.353197f, -0.778260f, -0.249580f, 221 0.046598f, -0.140169f, -0.585684f, -0.353197f, -0.778260f, -0.249580f,
226 -0.340192f, -0.315790f, 0.634238f, 0.063371f, 0.042244f, 0.548619f, 222 -0.340192f, -0.315790f, 0.634238f, 0.063371f, 0.042244f, 0.548619f,
227 -0.759474f, 0.250900f, -0.306703f, -0.330761f, 0.149233f, 0.727875f, 223 -0.759474f, 0.250900f, -0.306703f, -0.330761f, 0.149233f, 0.727875f,
228 -0.602874f, 0.344902f, 0.803663f, -0.601686f, -0.403432f, -0.006959f, 224 -0.602874f, 0.344902f, 0.803663f, -0.601686f, -0.403432f, -0.006959f,
229 0.779808f, 0.002829f, -0.446010f, 0.067916f, 0.148499f, -0.174391f, 225 0.779808f, 0.002829f, -0.446010f, 0.067916f, 0.148499f, -0.174391f,
230 -0.970473f, 0.405530f, 0.013494f, -0.237468f, -0.870137f, -0.282840f, 226 -0.970473f, 0.405530f, 0.013494f, -0.237468f, -0.870137f, -0.282840f,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 -0.544495f, 0.264199f, 0.647938f, 0.565569f, 0.496231f, 0.271340f, 300 -0.544495f, 0.264199f, 0.647938f, 0.565569f, 0.496231f, 0.271340f,
305 0.519944f, 0.318094f, -0.792999f, 0.733421f, -1.000000f, 0.103977f, 301 0.519944f, 0.318094f, -0.792999f, 0.733421f, -1.000000f, 0.103977f,
306 0.981719f, 0.314859f, 0.476882f, 0.514267f, -0.196381f, -0.425781f, 302 0.981719f, 0.314859f, 0.476882f, 0.514267f, -0.196381f, -0.425781f,
307 -0.783081f, 0.101108f, 0.419782f, -0.291718f, 0.183355f, -0.332489f}; 303 -0.783081f, 0.101108f, 0.419782f, -0.291718f, 0.183355f, -0.332489f};
308 304
309 RunBitexactnessTest( 305 RunBitexactnessTest(
310 8000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 306 8000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
311 CreateVector(rtc::ArrayView<const float>(kReference))); 307 CreateVector(rtc::ArrayView<const float>(kReference)));
312 } 308 }
313 309
314 TEST(HighPassFilterBitExactnessTest, Mono16kHzInitial) { 310 TEST(LowCutFilterBitExactnessTest, Mono16kHzInitial) {
315 const float kReferenceInput[] = { 311 const float kReferenceInput[] = {
316 0.150254f, 0.512488f, -0.631245f, 0.240938f, 0.089080f, -0.365440f, 312 0.150254f, 0.512488f, -0.631245f, 0.240938f, 0.089080f, -0.365440f,
317 -0.121169f, 0.095748f, 1.000000f, 0.773932f, -0.377232f, 0.848124f, 313 -0.121169f, 0.095748f, 1.000000f, 0.773932f, -0.377232f, 0.848124f,
318 0.202718f, -0.017621f, 0.199738f, -0.057279f, -0.034693f, 0.416303f, 314 0.202718f, -0.017621f, 0.199738f, -0.057279f, -0.034693f, 0.416303f,
319 0.393761f, 0.396041f, 0.187653f, -0.337438f, 0.200436f, 0.455577f, 315 0.393761f, 0.396041f, 0.187653f, -0.337438f, 0.200436f, 0.455577f,
320 0.136624f, 0.289150f, 0.203131f, -0.084798f, 0.082124f, -0.220010f, 316 0.136624f, 0.289150f, 0.203131f, -0.084798f, 0.082124f, -0.220010f,
321 0.248266f, -0.320554f, -0.298701f, -0.226218f, -0.822794f, 0.401962f, 317 0.248266f, -0.320554f, -0.298701f, -0.226218f, -0.822794f, 0.401962f,
322 0.090876f, -0.210968f, 0.382936f, -0.478291f, -0.028572f, -0.067474f, 318 0.090876f, -0.210968f, 0.382936f, -0.478291f, -0.028572f, -0.067474f,
323 0.089204f, 0.087430f, -0.241695f, -0.008398f, -0.046076f, 0.175416f, 319 0.089204f, 0.087430f, -0.241695f, -0.008398f, -0.046076f, 0.175416f,
324 0.305518f, 0.309992f, -0.241352f, 0.021618f, -0.339291f, -0.311173f, 320 0.305518f, 0.309992f, -0.241352f, 0.021618f, -0.339291f, -0.311173f,
(...skipping 18 matching lines...) Expand all
343 339
344 const float kReference[] = {0.147160f, 0.495163f, -0.648346f, 0.234931f, 340 const float kReference[] = {0.147160f, 0.495163f, -0.648346f, 0.234931f,
345 0.075289f, -0.373779f, -0.117676f, 0.100345f, 341 0.075289f, -0.373779f, -0.117676f, 0.100345f,
346 0.981719f, 0.714896f, -0.447357f, 0.770867f}; 342 0.981719f, 0.714896f, -0.447357f, 0.770867f};
347 343
348 RunBitexactnessTest( 344 RunBitexactnessTest(
349 16000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 345 16000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
350 CreateVector(rtc::ArrayView<const float>(kReference))); 346 CreateVector(rtc::ArrayView<const float>(kReference)));
351 } 347 }
352 348
353 TEST(HighPassFilterBitExactnessTest, Mono16kHzConverged) { 349 TEST(LowCutFilterBitExactnessTest, Mono16kHzConverged) {
354 const float kReferenceInput[] = { 350 const float kReferenceInput[] = {
355 0.150254f, 0.512488f, -0.631245f, 0.240938f, 0.089080f, -0.365440f, 351 0.150254f, 0.512488f, -0.631245f, 0.240938f, 0.089080f, -0.365440f,
356 -0.121169f, 0.095748f, 1.000000f, 0.773932f, -0.377232f, 0.848124f, 352 -0.121169f, 0.095748f, 1.000000f, 0.773932f, -0.377232f, 0.848124f,
357 0.202718f, -0.017621f, 0.199738f, -0.057279f, -0.034693f, 0.416303f, 353 0.202718f, -0.017621f, 0.199738f, -0.057279f, -0.034693f, 0.416303f,
358 0.393761f, 0.396041f, 0.187653f, -0.337438f, 0.200436f, 0.455577f, 354 0.393761f, 0.396041f, 0.187653f, -0.337438f, 0.200436f, 0.455577f,
359 0.136624f, 0.289150f, 0.203131f, -0.084798f, 0.082124f, -0.220010f, 355 0.136624f, 0.289150f, 0.203131f, -0.084798f, 0.082124f, -0.220010f,
360 0.248266f, -0.320554f, -0.298701f, -0.226218f, -0.822794f, 0.401962f, 356 0.248266f, -0.320554f, -0.298701f, -0.226218f, -0.822794f, 0.401962f,
361 0.090876f, -0.210968f, 0.382936f, -0.478291f, -0.028572f, -0.067474f, 357 0.090876f, -0.210968f, 0.382936f, -0.478291f, -0.028572f, -0.067474f,
362 0.089204f, 0.087430f, -0.241695f, -0.008398f, -0.046076f, 0.175416f, 358 0.089204f, 0.087430f, -0.241695f, -0.008398f, -0.046076f, 0.175416f,
363 0.305518f, 0.309992f, -0.241352f, 0.021618f, -0.339291f, -0.311173f, 359 0.305518f, 0.309992f, -0.241352f, 0.021618f, -0.339291f, -0.311173f,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 431
436 const float kReference[] = {-0.248962f, -0.088257f, 0.083041f, -0.037323f, 432 const float kReference[] = {-0.248962f, -0.088257f, 0.083041f, -0.037323f,
437 0.127659f, 0.149388f, -0.220978f, -0.004242f, 433 0.127659f, 0.149388f, -0.220978f, -0.004242f,
438 -0.538544f, 0.384289f, -0.117615f, -0.268524f}; 434 -0.538544f, 0.384289f, -0.117615f, -0.268524f};
439 435
440 RunBitexactnessTest( 436 RunBitexactnessTest(
441 16000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 437 16000, 1, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
442 CreateVector(rtc::ArrayView<const float>(kReference))); 438 CreateVector(rtc::ArrayView<const float>(kReference)));
443 } 439 }
444 440
445 TEST(HighPassFilterBitExactnessTest, Stereo16kHzInitial) { 441 TEST(LowCutFilterBitExactnessTest, Stereo16kHzInitial) {
446 const float kReferenceInput[] = { 442 const float kReferenceInput[] = {
447 0.087390f, -0.370759f, -0.235918f, 0.583079f, 0.678359f, 0.360473f, 443 0.087390f, -0.370759f, -0.235918f, 0.583079f, 0.678359f, 0.360473f,
448 -0.166156f, 0.285780f, -0.571837f, 0.234542f, 0.350382f, 0.202047f, 444 -0.166156f, 0.285780f, -0.571837f, 0.234542f, 0.350382f, 0.202047f,
449 -0.307381f, -0.271197f, -0.657038f, 0.590723f, -0.014666f, -0.290754f, 445 -0.307381f, -0.271197f, -0.657038f, 0.590723f, -0.014666f, -0.290754f,
450 0.550122f, -0.526390f, 0.689667f, 0.633054f, 0.692457f, -0.259626f, 446 0.550122f, -0.526390f, 0.689667f, 0.633054f, 0.692457f, -0.259626f,
451 -0.233541f, 0.722669f, -0.072182f, 0.141096f, 0.390614f, 0.921835f, 447 -0.233541f, 0.722669f, -0.072182f, 0.141096f, 0.390614f, 0.921835f,
452 0.092626f, 0.273153f, 0.141785f, 0.854224f, 0.727531f, -0.660321f, 448 0.092626f, 0.273153f, 0.141785f, 0.854224f, 0.727531f, -0.660321f,
453 -0.642602f, -0.512991f, 0.503559f, -0.601731f, 0.965881f, 0.419277f, 449 -0.642602f, -0.512991f, 0.503559f, -0.601731f, 0.965881f, 0.419277f,
454 -0.649128f, 0.716595f, 0.818823f, 0.923326f, 0.141199f, 0.125758f, 450 -0.649128f, 0.716595f, 0.818823f, 0.923326f, 0.141199f, 0.125758f,
455 -0.646678f, 0.027358f, 0.096944f, -0.669445f, -0.012214f, 0.070235f, 451 -0.646678f, 0.027358f, 0.096944f, -0.669445f, -0.012214f, 0.070235f,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 0.085604f, -0.367126f, -0.218170f, 0.594653f, 0.661245f, 0.319041f, 499 0.085604f, -0.367126f, -0.218170f, 0.594653f, 0.661245f, 0.319041f,
504 -0.212891f, 0.237800f, -0.614716f, 0.201758f, 0.305032f, 0.144414f, 500 -0.212891f, 0.237800f, -0.614716f, 0.201758f, 0.305032f, 0.144414f,
505 -0.936523f, 0.647359f, -0.613403f, -0.611542f, -0.549835f, 0.477004f, 501 -0.936523f, 0.647359f, -0.613403f, -0.611542f, -0.549835f, 0.477004f,
506 -0.477386f, -0.287262f, 0.650746f, 0.101169f, 0.899258f, -0.808014f}; 502 -0.477386f, -0.287262f, 0.650746f, 0.101169f, 0.899258f, -0.808014f};
507 503
508 RunBitexactnessTest( 504 RunBitexactnessTest(
509 16000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 505 16000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
510 CreateVector(rtc::ArrayView<const float>(kReference))); 506 CreateVector(rtc::ArrayView<const float>(kReference)));
511 } 507 }
512 508
513 TEST(HighPassFilterBitExactnessTest, Stereo16kHzConverged) { 509 TEST(LowCutFilterBitExactnessTest, Stereo16kHzConverged) {
514 const float kReferenceInput[] = { 510 const float kReferenceInput[] = {
515 -0.145875f, 0.910744f, 0.448494f, 0.161783f, 0.080516f, 0.410882f, 511 -0.145875f, 0.910744f, 0.448494f, 0.161783f, 0.080516f, 0.410882f,
516 -0.989942f, 0.565032f, 0.853719f, -0.983409f, 0.649257f, 0.534672f, 512 -0.989942f, 0.565032f, 0.853719f, -0.983409f, 0.649257f, 0.534672f,
517 0.994274f, -0.544694f, 0.839084f, 0.283999f, -0.789360f, -0.463678f, 513 0.994274f, -0.544694f, 0.839084f, 0.283999f, -0.789360f, -0.463678f,
518 0.527688f, 0.611020f, -0.791494f, -0.060482f, -0.561876f, 0.845416f, 514 0.527688f, 0.611020f, -0.791494f, -0.060482f, -0.561876f, 0.845416f,
519 -0.359355f, 0.715088f, -0.480307f, 0.756126f, -0.623465f, 0.518388f, 515 -0.359355f, 0.715088f, -0.480307f, 0.756126f, -0.623465f, 0.518388f,
520 -0.936621f, 0.284678f, 0.133742f, -0.247181f, -0.574903f, 0.584314f, 516 -0.936621f, 0.284678f, 0.133742f, -0.247181f, -0.574903f, 0.584314f,
521 -0.709113f, -0.021715f, -0.974309f, -0.626776f, -0.029539f, 0.676452f, 517 -0.709113f, -0.021715f, -0.974309f, -0.626776f, -0.029539f, 0.676452f,
522 -0.717886f, 0.464434f, 0.382134f, -0.931015f, -0.022285f, 0.942781f, 518 -0.717886f, 0.464434f, 0.382134f, -0.931015f, -0.022285f, 0.942781f,
523 -0.775097f, 0.486428f, 0.277083f, 0.188366f, -0.002755f, 0.135705f, 519 -0.775097f, 0.486428f, 0.277083f, 0.188366f, -0.002755f, 0.135705f,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 -0.816528f, 0.085421f, 0.739647f, -0.922089f, 0.669301f, -0.048187f, 673 -0.816528f, 0.085421f, 0.739647f, -0.922089f, 0.669301f, -0.048187f,
678 -0.290039f, -0.818085f, -0.596008f, -0.177826f, -0.002197f, -0.350647f, 674 -0.290039f, -0.818085f, -0.596008f, -0.177826f, -0.002197f, -0.350647f,
679 -0.064301f, 0.337291f, -0.621765f, 0.115909f, 0.311899f, -0.915924f, 675 -0.064301f, 0.337291f, -0.621765f, 0.115909f, 0.311899f, -0.915924f,
680 0.020478f, 0.836055f, -0.714020f, -0.037140f, 0.391125f, -0.340118f}; 676 0.020478f, 0.836055f, -0.714020f, -0.037140f, 0.391125f, -0.340118f};
681 677
682 RunBitexactnessTest( 678 RunBitexactnessTest(
683 16000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)), 679 16000, 2, CreateVector(rtc::ArrayView<const float>(kReferenceInput)),
684 CreateVector(rtc::ArrayView<const float>(kReference))); 680 CreateVector(rtc::ArrayView<const float>(kReference)));
685 } 681 }
686 } // namespace webrtc 682 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/low_cut_filter.cc ('k') | webrtc/modules/audio_processing/test/aec_dump_based_simulator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698