1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ 12 #define MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ 13 14 #include <array> 15 #include <vector> 16 17 #include "modules/audio_processing/aec3/aec3_common.h" 18 #include "modules/audio_processing/aec3/aec3_fft.h" 19 #include "modules/audio_processing/aec3/fft_data.h" 20 #include "rtc_base/constructor_magic.h" 21 22 namespace webrtc { 23 24 class SuppressionFilter { 25 public: 26 SuppressionFilter(Aec3Optimization optimization, 27 int sample_rate_hz, 28 size_t num_capture_channels_); 29 ~SuppressionFilter(); 30 void ApplyGain(rtc::ArrayView<const FftData> comfort_noise, 31 rtc::ArrayView<const FftData> comfort_noise_high_bands, 32 const std::array<float, kFftLengthBy2Plus1>& suppression_gain, 33 float high_bands_gain, 34 rtc::ArrayView<const FftData> E_lowest_band, 35 std::vector<std::vector<std::vector<float>>>* e); 36 37 private: 38 const Aec3Optimization optimization_; 39 const int sample_rate_hz_; 40 const size_t num_capture_channels_; 41 const Aec3Fft fft_; 42 std::vector<std::vector<std::array<float, kFftLengthBy2>>> e_output_old_; 43 RTC_DISALLOW_COPY_AND_ASSIGN(SuppressionFilter); 44 }; 45 46 } // namespace webrtc 47 48 #endif // MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ 49