OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #define _USE_MATH_DEFINES | 11 #define _USE_MATH_DEFINES |
12 | 12 |
13 #include "webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h" | 13 #include "webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h" |
14 | 14 |
15 #include <algorithm> | 15 #include <algorithm> |
16 #include <cmath> | 16 #include <cmath> |
17 #include <numeric> | 17 #include <numeric> |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
| 20 #include "webrtc/base/arraysize.h" |
20 #include "webrtc/common_audio/window_generator.h" | 21 #include "webrtc/common_audio/window_generator.h" |
21 #include "webrtc/modules/audio_processing/beamformer/covariance_matrix_generator
.h" | 22 #include "webrtc/modules/audio_processing/beamformer/covariance_matrix_generator
.h" |
22 #include "webrtc/rtc_base/arraysize.h" | |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 namespace { | 25 namespace { |
26 | 26 |
27 // Alpha for the Kaiser Bessel Derived window. | 27 // Alpha for the Kaiser Bessel Derived window. |
28 const float kKbdAlpha = 1.5f; | 28 const float kKbdAlpha = 1.5f; |
29 | 29 |
30 const float kSpeedOfSoundMeterSeconds = 343; | 30 const float kSpeedOfSoundMeterSeconds = 343; |
31 | 31 |
32 // The minimum separation in radians between the target direction and an | 32 // The minimum separation in radians between the target direction and an |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 new_mask_ + high_mean_end_bin_ + 1); | 590 new_mask_ + high_mean_end_bin_ + 1); |
591 if (new_mask_[quantile] > kMaskTargetThreshold) { | 591 if (new_mask_[quantile] > kMaskTargetThreshold) { |
592 is_target_present_ = true; | 592 is_target_present_ = true; |
593 interference_blocks_count_ = 0; | 593 interference_blocks_count_ = 0; |
594 } else { | 594 } else { |
595 is_target_present_ = interference_blocks_count_++ < hold_target_blocks_; | 595 is_target_present_ = interference_blocks_count_++ < hold_target_blocks_; |
596 } | 596 } |
597 } | 597 } |
598 | 598 |
599 } // namespace webrtc | 599 } // namespace webrtc |
OLD | NEW |