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, |