1 /* 2 * Copyright (c) 2012 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_HIGH_PASS_FILTER_H_ 12 #define MODULES_AUDIO_PROCESSING_HIGH_PASS_FILTER_H_ 13 14 #include <memory> 15 #include <vector> 16 17 #include "api/array_view.h" 18 #include "modules/audio_processing/utility/cascaded_biquad_filter.h" 19 20 namespace webrtc { 21 22 class AudioBuffer; 23 24 class HighPassFilter { 25 public: 26 HighPassFilter(int sample_rate_hz, size_t num_channels); 27 ~HighPassFilter(); 28 HighPassFilter(const HighPassFilter&) = delete; 29 HighPassFilter& operator=(const HighPassFilter&) = delete; 30 31 void Process(AudioBuffer* audio, bool use_split_band_data); 32 void Process(std::vector<std::vector<float>>* audio); 33 void Reset(); 34 void Reset(size_t num_channels); 35 sample_rate_hz()36 int sample_rate_hz() const { return sample_rate_hz_; } num_channels()37 size_t num_channels() const { return filters_.size(); } 38 39 private: 40 const int sample_rate_hz_; 41 std::vector<std::unique_ptr<CascadedBiQuadFilter>> filters_; 42 }; 43 } // namespace webrtc 44 45 #endif // MODULES_AUDIO_PROCESSING_HIGH_PASS_FILTER_H_ 46