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..f3fc6b2175241bf6e118fa9e57e3829d49852287 100644 |
--- a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc |
+++ b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc |
@@ -50,6 +50,9 @@ const float kInterfAngleRadians = static_cast<float>(M_PI) / 4.f; |
// Rpsi = Rpsi_angled * kBalance + Rpsi_uniform * (1 - kBalance) |
const float kBalance = 0.4f; |
+// The width of half of the beam in radians. |
+const float kBeamWidthAngle = static_cast<float>(M_PI)20.f / 180.f; |
aluebs-webrtc
2015/06/25 01:04:36
const float kBeamWidthAngle = static_cast<float>(M
Andrew MacDonald
2015/06/26 02:04:24
I think you can omit the cast.
bloch
2015/06/26 03:37:28
I tried it without the cast and there were some co
Andrew MacDonald
2015/06/26 03:46:09
OK, thanks for trying.
|
+ |
// TODO(claguna): need comment here. |
const float kBeamwidthConstant = 0.00002f; |
@@ -334,6 +337,12 @@ void NonlinearBeamformer::ProcessChunk(const ChannelBuffer<float>& input, |
} |
} |
+bool NonlinearBeamformer::IsInBeam(float azimuth) { |
+ // If more than half-beamwidth degrees away from the beam's center, |
+ // you are out of the beam. |
+ return fabs(azimuth - kTargetAngleRadians) < kBeamWidthAngle; |
+} |
+ |
void NonlinearBeamformer::ProcessAudioBlock(const complex_f* const* input, |
int num_input_channels, |
int num_freq_bins, |