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

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

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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h
diff --git a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h
index e04a00296e3ff6584ca7fc95e19c0f0dbb9e950a..1cb6dd8d3550f3019b0f48ce85813cbffc0af1c2 100644
--- a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h
+++ b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h
@@ -31,7 +31,8 @@ class NonlinearBeamformer
: public Beamformer<float>,
public LappedTransform::Callback {
public:
- explicit NonlinearBeamformer(const std::vector<Point>& array_geometry);
+ explicit NonlinearBeamformer(const std::vector<Point>& array_geometry,
+ float target_angle_radians = M_PI / 2.f);
Andrew MacDonald 2015/10/14 22:12:31 Since we're exposing a setter, I think it's redund
aluebs-webrtc 2015/10/20 00:04:20 Since it has a default value, it is not necessary
// Sample rate corresponds to the lower band.
// Needs to be called before the NonlinearBeamformer can be used.
@@ -44,6 +45,8 @@ class NonlinearBeamformer
void ProcessChunk(const ChannelBuffer<float>& input,
ChannelBuffer<float>* output) override;
+ void SteerBeam(float target_angle_radians);
peah-webrtc 2015/10/13 12:53:41 My gut feeling is that it would be simpler for an
Andrew MacDonald 2015/10/14 22:12:31 This seems like a fairly generic beamformer task.
aluebs-webrtc 2015/10/20 00:04:20 Agreed. Added.
aluebs-webrtc 2015/10/20 00:04:20 That is true for human input, but this is probably
peah-webrtc 2015/10/20 21:22:33 Acknowledged.
+
bool IsInBeam(const SphericalPointf& spherical_point) override;
// After processing each block |is_target_present_| is set to true if the
@@ -66,11 +69,14 @@ class NonlinearBeamformer
typedef ComplexMatrix<float> ComplexMatrixF;
typedef complex<float> complex_f;
- void InitFrequencyCorrectionRanges();
+ void InitLowFrequencyCorrectionRanges();
+ void InitHighFrequencyCorrectionRanges();
void InitInterfAngles();
void InitDelaySumMasks();
void InitTargetCovMats();
+ void InitDifuseCovMats();
void InitInterfCovMats();
+ void NormalizeCovMats();
// Calculates postfilter masks that minimize the mean squared error of our
// estimation of the desired signal.
@@ -133,6 +139,10 @@ class NonlinearBeamformer
// Time and frequency smoothed mask.
float final_mask_[kNumFreqBins];
+ // For both target and interference angles, PI / 2 is perpendicular to the
+ // microphone array, facing forwards. The positive direction goes
+ // counterclockwise.
Andrew MacDonald 2015/10/14 22:12:31 This is really about our coordinate system, and sp
aluebs-webrtc 2015/10/20 00:04:20 I am not sure if we want to impose a specific conv
+ float target_angle_radians_;
// Angles of the interferer scenarios.
std::vector<float> interf_angles_radians_;
@@ -140,10 +150,10 @@ class NonlinearBeamformer
ComplexMatrixF delay_sum_masks_[kNumFreqBins];
ComplexMatrixF normalized_delay_sum_masks_[kNumFreqBins];
- // Array of length |kNumFreqBins|, Matrix of size |num_input_channels_| x
+ // Arrays of length |kNumFreqBins|, Matrix of size |num_input_channels_| x
// |num_input_channels_|.
ComplexMatrixF target_cov_mats_[kNumFreqBins];
-
+ ComplexMatrixF uniform_cov_mat_[kNumFreqBins];
// Array of length |kNumFreqBins|, Matrix of size |num_input_channels_| x
// |num_input_channels_|. ScopedVector has a size equal to the number of
// interferer scenarios.

Powered by Google App Engine
This is Rietveld 408576698