2017-02-08 05:08:56 -08:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-11-17 14:54:28 +01:00
|
|
|
#ifndef MODULES_AUDIO_PROCESSING_AEC3_DECIMATOR_H_
|
|
|
|
|
#define MODULES_AUDIO_PROCESSING_AEC3_DECIMATOR_H_
|
2017-02-08 05:08:56 -08:00
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/array_view.h"
|
|
|
|
|
#include "modules/audio_processing/aec3/aec3_common.h"
|
|
|
|
|
#include "modules/audio_processing/aec3/cascaded_biquad_filter.h"
|
|
|
|
|
#include "rtc_base/constructormagic.h"
|
2017-02-08 05:08:56 -08:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2017-11-17 14:54:28 +01:00
|
|
|
// Provides functionality for decimating a signal.
|
|
|
|
|
class Decimator {
|
2017-02-08 05:08:56 -08:00
|
|
|
public:
|
2017-11-17 14:54:28 +01:00
|
|
|
explicit Decimator(size_t down_sampling_factor);
|
2017-02-08 05:08:56 -08:00
|
|
|
|
|
|
|
|
// Downsamples the signal.
|
2017-04-05 14:18:07 -07:00
|
|
|
void Decimate(rtc::ArrayView<const float> in, rtc::ArrayView<float> out);
|
2017-02-08 05:08:56 -08:00
|
|
|
|
|
|
|
|
private:
|
2017-11-17 14:54:28 +01:00
|
|
|
const size_t down_sampling_factor_;
|
2017-02-08 05:08:56 -08:00
|
|
|
CascadedBiQuadFilter low_pass_filter_;
|
2018-05-18 15:45:09 +02:00
|
|
|
CascadedBiQuadFilter high_pass_filter_;
|
2017-02-08 05:08:56 -08:00
|
|
|
|
2017-11-17 14:54:28 +01:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(Decimator);
|
2017-02-08 05:08:56 -08:00
|
|
|
};
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-11-17 14:54:28 +01:00
|
|
|
#endif // MODULES_AUDIO_PROCESSING_AEC3_DECIMATOR_H_
|