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

Unified Diff: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc

Issue 1388033002: Make the separation between target and interferer scenario depend on microphone spacing in Nonlinea… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@nlbf3
Patch Set: Formatting 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h ('k') | webrtc/modules/modules.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
diff --git a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
index 40e738c6d1fc6a4735763c178dc3259124435d17..20e6b55c15709a6268834fddde7c0f85cc8610f8 100644
--- a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
+++ b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
@@ -36,6 +36,14 @@ const float kSpeedOfSoundMeterSeconds = 343;
// TODO(aluebs): Make the target angle dynamically settable.
const float kTargetAngleRadians = static_cast<float>(M_PI) / 2.f;
+// The minimum separation in radians between the target direction and an
+// interferer scenario.
+const float kMinAwayRadians = 0.2f;
+
+// The separation between the target direction and the closest interferer
+// scenario is proportional to this constant.
+const float kAwaySlope = 0.008f;
+
// When calculating the interference covariance matrix, this is the weight for
// the weighted average between the uniform covariance matrix and the angled
// covariance matrix.
@@ -189,8 +197,9 @@ const size_t NonlinearBeamformer::kNumFreqBins;
NonlinearBeamformer::NonlinearBeamformer(
const std::vector<Point>& array_geometry)
- : num_input_channels_(array_geometry.size()),
- array_geometry_(GetCenteredArray(array_geometry)) {
+ : num_input_channels_(array_geometry.size()),
+ array_geometry_(GetCenteredArray(array_geometry)),
+ min_mic_spacing_(GetMinimumSpacing(array_geometry)) {
WindowGenerator::KaiserBesselDerived(kKbdAlpha, kFftSize, window_);
}
@@ -253,8 +262,10 @@ void NonlinearBeamformer::Initialize(int chunk_size_ms, int sample_rate_hz) {
}
void NonlinearBeamformer::InitInterfAngles() {
- // TODO(aluebs): Make kAwayRadians dependent on the mic spacing.
- const float kAwayRadians = 0.5;
+ const float kAwayRadians =
+ std::min(static_cast<float>(M_PI),
+ std::max(kMinAwayRadians, kAwaySlope * static_cast<float>(M_PI) /
+ min_mic_spacing_));
interf_angles_radians_.clear();
// TODO(aluebs): When the target angle is settable, make sure the interferer
« no previous file with comments | « webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h ('k') | webrtc/modules/modules.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698