Home | History | Annotate | Download | only in source
      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 
     11 /*
     12  * This file includes the constant values used internally in VAD.
     13  */
     14 
     15 #include "vad_const.h"
     16 
     17 // Spectrum Weighting
     18 const WebRtc_Word16 kSpectrumWeight[6] = {6, 8, 10, 12, 14, 16};
     19 
     20 const WebRtc_Word16 kCompVar = 22005;
     21 
     22 // Constant 160*log10(2) in Q9
     23 const WebRtc_Word16 kLogConst = 24660;
     24 
     25 // Constant log2(exp(1)) in Q12
     26 const WebRtc_Word16 kLog10Const = 5909;
     27 
     28 // Q15
     29 const WebRtc_Word16 kNoiseUpdateConst = 655;
     30 const WebRtc_Word16 kSpeechUpdateConst = 6554;
     31 
     32 // Q8
     33 const WebRtc_Word16 kBackEta = 154;
     34 
     35 // Coefficients used by WebRtcVad_HpOutput, Q14
     36 const WebRtc_Word16 kHpZeroCoefs[3] = {6631, -13262, 6631};
     37 const WebRtc_Word16 kHpPoleCoefs[3] = {16384, -7756, 5620};
     38 
     39 // Allpass filter coefficients, upper and lower, in Q15
     40 // Upper: 0.64, Lower: 0.17
     41 const WebRtc_Word16 kAllPassCoefsQ15[2] = {20972, 5571};
     42 const WebRtc_Word16 kAllPassCoefsQ13[2] = {5243, 1392}; // Q13
     43 
     44 // Minimum difference between the two models, Q5
     45 const WebRtc_Word16 kMinimumDifference[6] = {544, 544, 576, 576, 576, 576};
     46 
     47 // Upper limit of mean value for speech model, Q7
     48 const WebRtc_Word16 kMaximumSpeech[6] = {11392, 11392, 11520, 11520, 11520, 11520};
     49 
     50 // Minimum value for mean value
     51 const WebRtc_Word16 kMinimumMean[2] = {640, 768};
     52 
     53 // Upper limit of mean value for noise model, Q7
     54 const WebRtc_Word16 kMaximumNoise[6] = {9216, 9088, 8960, 8832, 8704, 8576};
     55 
     56 // Adjustment for division with two in WebRtcVad_SplitFilter
     57 const WebRtc_Word16 kOffsetVector[6] = {368, 368, 272, 176, 176, 176};
     58 
     59 // Start values for the Gaussian models, Q7
     60 // Weights for the two Gaussians for the six channels (noise)
     61 const WebRtc_Word16 kNoiseDataWeights[12] = {34, 62, 72, 66, 53, 25, 94, 66, 56, 62, 75, 103};
     62 
     63 // Weights for the two Gaussians for the six channels (speech)
     64 const WebRtc_Word16 kSpeechDataWeights[12] = {48, 82, 45, 87, 50, 47, 80, 46, 83, 41, 78, 81};
     65 
     66 // Means for the two Gaussians for the six channels (noise)
     67 const WebRtc_Word16 kNoiseDataMeans[12] = {6738, 4892, 7065, 6715, 6771, 3369, 7646, 3863,
     68         7820, 7266, 5020, 4362};
     69 
     70 // Means for the two Gaussians for the six channels (speech)
     71 const WebRtc_Word16 kSpeechDataMeans[12] = {8306, 10085, 10078, 11823, 11843, 6309, 9473,
     72         9571, 10879, 7581, 8180, 7483};
     73 
     74 // Stds for the two Gaussians for the six channels (noise)
     75 const WebRtc_Word16 kNoiseDataStds[12] = {378, 1064, 493, 582, 688, 593, 474, 697, 475, 688,
     76         421, 455};
     77 
     78 // Stds for the two Gaussians for the six channels (speech)
     79 const WebRtc_Word16 kSpeechDataStds[12] = {555, 505, 567, 524, 585, 1231, 509, 828, 492, 1540,
     80         1079, 850};
     81