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 4c79c01143344452dc1fd8a256d2a38d3a8de766..43b0df0bfdc7349dfed8e4f8acfc66cebfe7498d 100644 |
--- a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h |
+++ b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h |
@@ -31,7 +31,9 @@ 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, |
+ SphericalPointf target_direction = SphericalPointf(M_PI / 2.f, 0.f, 1.f)); |
// Sample rate corresponds to the lower band. |
// Needs to be called before the NonlinearBeamformer can be used. |
@@ -44,6 +46,8 @@ class NonlinearBeamformer |
void ProcessChunk(const ChannelBuffer<float>& input, |
ChannelBuffer<float>* output) override; |
+ void AimAt(const SphericalPointf& target_direction) override; |
+ |
bool IsInBeam(const SphericalPointf& spherical_point) override; |
// After processing each block |is_target_present_| is set to true if the |
@@ -66,11 +70,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 InitDiffuseCovMats(); |
void InitInterfCovMats(); |
+ void NormalizeCovMats(); |
// Calculates postfilter masks that minimize the mean squared error of our |
// estimation of the desired signal. |
@@ -133,6 +140,7 @@ class NonlinearBeamformer |
// Time and frequency smoothed mask. |
float final_mask_[kNumFreqBins]; |
+ float target_angle_radians_; |
// Angles of the interferer scenarios. |
std::vector<float> interf_angles_radians_; |
@@ -140,10 +148,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. |