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

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

Issue 1211613005: Adding method IsInBeam to beamformer class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: changed azimuth to point in comment Created 5 years, 6 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') | no next file » | 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 1e03c853fe05909eb4a98251b1c8b097578301f9..66ad6259a3690c31f96668c6d9c206ed1ae9cca7 100644
--- a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
+++ b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
@@ -50,6 +50,8 @@ const float kInterfAngleRadians = static_cast<float>(M_PI) / 4.f;
// Rpsi = Rpsi_angled * kBalance + Rpsi_uniform * (1 - kBalance)
const float kBalance = 0.4f;
+const float kHalfBeamWidthRadians = static_cast<float>(M_PI) * 20.f / 180.f;
+
// TODO(claguna): need comment here.
const float kBeamwidthConstant = 0.00002f;
@@ -334,6 +336,13 @@ void NonlinearBeamformer::ProcessChunk(const ChannelBuffer<float>& input,
}
}
+bool NonlinearBeamformer::IsInBeam(const SphericalPointf& spherical_point) {
+ // If more than half-beamwidth degrees away from the beam's center,
+ // you are out of the beam.
+ return fabs(spherical_point.azimuth() - kTargetAngleRadians) <
+ kHalfBeamWidthRadians;
+}
+
void NonlinearBeamformer::ProcessAudioBlock(const complex_f* const* input,
int num_input_channels,
int num_freq_bins,
« no previous file with comments | « webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698