vad_gmm.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2011 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. // Gaussian probability calculations internally used in vad_core.c.
  11. #ifndef COMMON_AUDIO_VAD_VAD_GMM_H_
  12. #define COMMON_AUDIO_VAD_VAD_GMM_H_
  13. #include <stdint.h>
  14. // Calculates the probability for |input|, given that |input| comes from a
  15. // normal distribution with mean and standard deviation (|mean|, |std|).
  16. //
  17. // Inputs:
  18. // - input : input sample in Q4.
  19. // - mean : mean input in the statistical model, Q7.
  20. // - std : standard deviation, Q7.
  21. //
  22. // Output:
  23. //
  24. // - delta : input used when updating the model, Q11.
  25. // |delta| = (|input| - |mean|) / |std|^2.
  26. //
  27. // Return:
  28. // (probability for |input|) =
  29. // 1 / |std| * exp(-(|input| - |mean|)^2 / (2 * |std|^2));
  30. int32_t WebRtcVad_GaussianProbability(int16_t input,
  31. int16_t mean,
  32. int16_t std,
  33. int16_t* delta);
  34. #endif // COMMON_AUDIO_VAD_VAD_GMM_H_