| 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 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // After processing each block |is_target_present_| is set to true if the | 60 // After processing each block |is_target_present_| is set to true if the |
| 61 // target signal es present and to false otherwise. This methods can be called | 61 // target signal es present and to false otherwise. This methods can be called |
| 62 // to know if the data is target signal or interference and process it | 62 // to know if the data is target signal or interference and process it |
| 63 // accordingly. | 63 // accordingly. |
| 64 bool is_target_present() override { return is_target_present_; } | 64 bool is_target_present() override { return is_target_present_; } |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 // Process one frequency-domain block of audio. This is where the fun | 67 // Process one frequency-domain block of audio. This is where the fun |
| 68 // happens. Implements LappedTransform::Callback. | 68 // happens. Implements LappedTransform::Callback. |
| 69 void ProcessAudioBlock(const complex<float>* const* input, | 69 void ProcessAudioBlock(const complex<float>* const* input, |
| 70 int num_input_channels, | 70 size_t num_input_channels, |
| 71 size_t num_freq_bins, | 71 size_t num_freq_bins, |
| 72 int num_output_channels, | 72 size_t num_output_channels, |
| 73 complex<float>* const* output) override; | 73 complex<float>* const* output) override; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 FRIEND_TEST_ALL_PREFIXES(NonlinearBeamformerTest, | 76 FRIEND_TEST_ALL_PREFIXES(NonlinearBeamformerTest, |
| 77 InterfAnglesTakeAmbiguityIntoAccount); | 77 InterfAnglesTakeAmbiguityIntoAccount); |
| 78 | 78 |
| 79 typedef Matrix<float> MatrixF; | 79 typedef Matrix<float> MatrixF; |
| 80 typedef ComplexMatrix<float> ComplexMatrixF; | 80 typedef ComplexMatrix<float> ComplexMatrixF; |
| 81 typedef complex<float> complex_f; | 81 typedef complex<float> complex_f; |
| 82 | 82 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 static const size_t kFftSize = 256; | 123 static const size_t kFftSize = 256; |
| 124 static const size_t kNumFreqBins = kFftSize / 2 + 1; | 124 static const size_t kNumFreqBins = kFftSize / 2 + 1; |
| 125 | 125 |
| 126 // Deals with the fft transform and blocking. | 126 // Deals with the fft transform and blocking. |
| 127 size_t chunk_length_; | 127 size_t chunk_length_; |
| 128 rtc::scoped_ptr<LappedTransform> lapped_transform_; | 128 rtc::scoped_ptr<LappedTransform> lapped_transform_; |
| 129 float window_[kFftSize]; | 129 float window_[kFftSize]; |
| 130 | 130 |
| 131 // Parameters exposed to the user. | 131 // Parameters exposed to the user. |
| 132 const int num_input_channels_; | 132 const size_t num_input_channels_; |
| 133 int sample_rate_hz_; | 133 int sample_rate_hz_; |
| 134 | 134 |
| 135 const std::vector<Point> array_geometry_; | 135 const std::vector<Point> array_geometry_; |
| 136 // The normal direction of the array if it has one and it is in the xy-plane. | 136 // The normal direction of the array if it has one and it is in the xy-plane. |
| 137 const rtc::Optional<Point> array_normal_; | 137 const rtc::Optional<Point> array_normal_; |
| 138 | 138 |
| 139 // Minimum spacing between microphone pairs. | 139 // Minimum spacing between microphone pairs. |
| 140 const float min_mic_spacing_; | 140 const float min_mic_spacing_; |
| 141 | 141 |
| 142 // Calculated based on user-input and constants in the .cc file. | 142 // Calculated based on user-input and constants in the .cc file. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // Number of blocks after which the data is considered interference if the | 191 // Number of blocks after which the data is considered interference if the |
| 192 // mask does not pass |kMaskSignalThreshold|. | 192 // mask does not pass |kMaskSignalThreshold|. |
| 193 size_t hold_target_blocks_; | 193 size_t hold_target_blocks_; |
| 194 // Number of blocks since the last mask that passed |kMaskSignalThreshold|. | 194 // Number of blocks since the last mask that passed |kMaskSignalThreshold|. |
| 195 size_t interference_blocks_count_; | 195 size_t interference_blocks_count_; |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 } // namespace webrtc | 198 } // namespace webrtc |
| 199 | 199 |
| 200 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ | 200 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ |
| OLD | NEW |