#include "modules/audio_processing/ns/signal_model_estimator.h"
#include "modules/audio_processing/ns/fast_math.h"
namespace webrtc {
namespace {
constexpr float kOneByFftSizeBy2Plus1 = …;
float ComputeSpectralDiff(
rtc::ArrayView<const float, kFftSizeBy2Plus1> conservative_noise_spectrum,
rtc::ArrayView<const float, kFftSizeBy2Plus1> signal_spectrum,
float signal_spectral_sum,
float diff_normalization) { … }
void UpdateSpectralFlatness(
rtc::ArrayView<const float, kFftSizeBy2Plus1> signal_spectrum,
float signal_spectral_sum,
float* spectral_flatness) { … }
void UpdateSpectralLrt(rtc::ArrayView<const float, kFftSizeBy2Plus1> prior_snr,
rtc::ArrayView<const float, kFftSizeBy2Plus1> post_snr,
rtc::ArrayView<float, kFftSizeBy2Plus1> avg_log_lrt,
float* lrt) { … }
}
SignalModelEstimator::SignalModelEstimator()
: … { … }
void SignalModelEstimator::AdjustNormalization(int32_t num_analyzed_frames,
float signal_energy) { … }
void SignalModelEstimator::Update(
rtc::ArrayView<const float, kFftSizeBy2Plus1> prior_snr,
rtc::ArrayView<const float, kFftSizeBy2Plus1> post_snr,
rtc::ArrayView<const float, kFftSizeBy2Plus1> conservative_noise_spectrum,
rtc::ArrayView<const float, kFftSizeBy2Plus1> signal_spectrum,
float signal_spectral_sum,
float signal_energy) { … }
}