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

Side by Side Diff: webrtc/modules/audio_processing/test/audioproc_float.cc

Issue 1394103003: Make the nonlinear beamformer steerable (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@highfreq
Patch Set: Created 5 years, 2 months 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) 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
(...skipping 19 matching lines...) Expand all
30 DEFINE_string(o_rev, 30 DEFINE_string(o_rev,
31 "out_rev.wav", 31 "out_rev.wav",
32 "Name of the reverse output file to write to."); 32 "Name of the reverse output file to write to.");
33 DEFINE_int32(out_channels, 0, "Number of output channels. Defaults to input."); 33 DEFINE_int32(out_channels, 0, "Number of output channels. Defaults to input.");
34 DEFINE_int32(out_sample_rate, 0, 34 DEFINE_int32(out_sample_rate, 0,
35 "Output sample rate in Hz. Defaults to input."); 35 "Output sample rate in Hz. Defaults to input.");
36 DEFINE_string(mic_positions, "", 36 DEFINE_string(mic_positions, "",
37 "Space delimited cartesian coordinates of microphones in meters. " 37 "Space delimited cartesian coordinates of microphones in meters. "
38 "The coordinates of each point are contiguous. " 38 "The coordinates of each point are contiguous. "
39 "For a two element array: \"x1 y1 z1 x2 y2 z2\""); 39 "For a two element array: \"x1 y1 z1 x2 y2 z2\"");
40 DEFINE_double(target_angle_degrees,
41 90,
42 "The azimuth of the target in radians");
40 43
41 DEFINE_bool(aec, false, "Enable echo cancellation."); 44 DEFINE_bool(aec, false, "Enable echo cancellation.");
42 DEFINE_bool(agc, false, "Enable automatic gain control."); 45 DEFINE_bool(agc, false, "Enable automatic gain control.");
43 DEFINE_bool(hpf, false, "Enable high-pass filtering."); 46 DEFINE_bool(hpf, false, "Enable high-pass filtering.");
44 DEFINE_bool(ns, false, "Enable noise suppression."); 47 DEFINE_bool(ns, false, "Enable noise suppression.");
45 DEFINE_bool(ts, false, "Enable transient suppression."); 48 DEFINE_bool(ts, false, "Enable transient suppression.");
46 DEFINE_bool(bf, false, "Enable beamforming."); 49 DEFINE_bool(bf, false, "Enable beamforming.");
47 DEFINE_bool(ie, false, "Enable intelligibility enhancer."); 50 DEFINE_bool(ie, false, "Enable intelligibility enhancer.");
48 DEFINE_bool(all, false, "Enable all components."); 51 DEFINE_bool(all, false, "Enable all components.");
49 52
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 Config config; 103 Config config;
101 config.Set<ExperimentalNs>(new ExperimentalNs(FLAGS_ts || FLAGS_all)); 104 config.Set<ExperimentalNs>(new ExperimentalNs(FLAGS_ts || FLAGS_all));
102 config.Set<Intelligibility>(new Intelligibility(FLAGS_ie || FLAGS_all)); 105 config.Set<Intelligibility>(new Intelligibility(FLAGS_ie || FLAGS_all));
103 106
104 if (FLAGS_bf || FLAGS_all) { 107 if (FLAGS_bf || FLAGS_all) {
105 const size_t num_mics = in_file.num_channels(); 108 const size_t num_mics = in_file.num_channels();
106 const std::vector<Point> array_geometry = 109 const std::vector<Point> array_geometry =
107 ParseArrayGeometry(FLAGS_mic_positions, num_mics); 110 ParseArrayGeometry(FLAGS_mic_positions, num_mics);
108 RTC_CHECK_EQ(array_geometry.size(), num_mics); 111 RTC_CHECK_EQ(array_geometry.size(), num_mics);
109 112
110 config.Set<Beamforming>(new Beamforming(true, array_geometry)); 113 config.Set<Beamforming>(new Beamforming(
114 true,
115 array_geometry,
116 M_PI * FLAGS_target_angle_degrees / 180.f));
peah-webrtc 2015/10/13 12:53:41 Since the usage is done using degrees, it would ma
aluebs-webrtc 2015/10/20 00:04:20 I only think this user will user degrees, since it
peah-webrtc 2015/10/20 21:22:33 Acknowledged.
111 } 117 }
112 118
113 rtc::scoped_ptr<AudioProcessing> ap(AudioProcessing::Create(config)); 119 rtc::scoped_ptr<AudioProcessing> ap(AudioProcessing::Create(config));
114 if (!FLAGS_dump.empty()) { 120 if (!FLAGS_dump.empty()) {
115 RTC_CHECK_EQ(kNoErr, 121 RTC_CHECK_EQ(kNoErr,
116 ap->echo_cancellation()->Enable(FLAGS_aec || FLAGS_all)); 122 ap->echo_cancellation()->Enable(FLAGS_aec || FLAGS_all));
117 } else if (FLAGS_aec) { 123 } else if (FLAGS_aec) {
118 fprintf(stderr, "-aec requires a -dump file.\n"); 124 fprintf(stderr, "-aec requires a -dump file.\n");
119 return -1; 125 return -1;
120 } 126 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 execution_time_ms * 1.f / num_chunks); 239 execution_time_ms * 1.f / num_chunks);
234 } 240 }
235 return 0; 241 return 0;
236 } 242 }
237 243
238 } // namespace webrtc 244 } // namespace webrtc
239 245
240 int main(int argc, char* argv[]) { 246 int main(int argc, char* argv[]) {
241 return webrtc::main(argc, argv); 247 return webrtc::main(argc, argv);
242 } 248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698