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 "rtc_base/constructormagic.h" 20 21 namespace webrtc { 22 23 class SuppressionFilter { 24 public: 25 explicit SuppressionFilter(int sample_rate_hz); 26 ~SuppressionFilter(); 27 void ApplyGain(const FftData& comfort_noise, 28 const FftData& comfort_noise_high_bands, 29 const std::array<float, kFftLengthBy2Plus1>& suppression_gain, 30 float high_bands_gain, 31 std::vector<std::vector<float>>* e); 32 33 private: 34 const int sample_rate_hz_; 35 const OouraFft ooura_fft_; 36 const Aec3Fft fft_; 37 std::array<float, kFftLengthBy2> e_input_old_; 38 std::vector<std::array<float, kFftLengthBy2>> e_output_old_; 39 RTC_DISALLOW_COPY_AND_ASSIGN(SuppressionFilter); 40 }; 41 42 } // namespace webrtc 43 44 #endif // MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ 45