/* * Copyright (c) 2011 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. */ #include "common_audio/vad/vad_gmm.h" #include "common_audio/signal_processing/include/signal_processing_library.h" static const int32_t kCompVar = …; static const int16_t kLog2Exp = …; // log2(exp(1)) in Q12. // For a normal distribution, the probability of `input` is calculated and // returned (in Q20). The formula for normal distributed probability is // // 1 / s * exp(-(x - m)^2 / (2 * s^2)) // // where the parameters are given in the following Q domains: // m = `mean` (Q7) // s = `std` (Q7) // x = `input` (Q4) // in addition to the probability we output `delta` (in Q11) used when updating // the noise/speech model. int32_t WebRtcVad_GaussianProbability(int16_t input, int16_t mean, int16_t std, int16_t* delta) { … }