Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h

Issue 1212543002: Pull the Voice Activity Detector out from the AGC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2012 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 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_AUDIO_PROC_INTERNAL_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_AUDIO_PROC_INTERNAL_H_
13
14 namespace webrtc {
15
16 // These values should match MATLAB counterparts for unit-tests to pass.
17 static const double kCorrWeight[] = {
18 1.000000, 0.985000, 0.970225, 0.955672, 0.941337, 0.927217, 0.913308,
19 0.899609, 0.886115, 0.872823, 0.859730, 0.846834, 0.834132, 0.821620,
20 0.809296, 0.797156, 0.785199
21 };
22
23 static const double kLpcAnalWin[] = {
24 0.00000000, 0.01314436, 0.02628645, 0.03942400, 0.05255473, 0.06567639,
25 0.07878670, 0.09188339, 0.10496421, 0.11802689, 0.13106918, 0.14408883,
26 0.15708358, 0.17005118, 0.18298941, 0.19589602, 0.20876878, 0.22160547,
27 0.23440387, 0.24716177, 0.25987696, 0.27254725, 0.28517045, 0.29774438,
28 0.31026687, 0.32273574, 0.33514885, 0.34750406, 0.35979922, 0.37203222,
29 0.38420093, 0.39630327, 0.40833713, 0.42030043, 0.43219112, 0.44400713,
30 0.45574642, 0.46740697, 0.47898676, 0.49048379, 0.50189608, 0.51322164,
31 0.52445853, 0.53560481, 0.54665854, 0.55761782, 0.56848075, 0.57924546,
32 0.58991008, 0.60047278, 0.61093173, 0.62128512, 0.63153117, 0.64166810,
33 0.65169416, 0.66160761, 0.67140676, 0.68108990, 0.69065536, 0.70010148,
34 0.70942664, 0.71862923, 0.72770765, 0.73666033, 0.74548573, 0.75418233,
35 0.76274862, 0.77118312, 0.77948437, 0.78765094, 0.79568142, 0.80357442,
36 0.81132858, 0.81894256, 0.82641504, 0.83374472, 0.84093036, 0.84797069,
37 0.85486451, 0.86161063, 0.86820787, 0.87465511, 0.88095122, 0.88709512,
38 0.89308574, 0.89892206, 0.90460306, 0.91012776, 0.91549520, 0.92070447,
39 0.92575465, 0.93064488, 0.93537432, 0.93994213, 0.94434755, 0.94858979,
40 0.95266814, 0.95658189, 0.96033035, 0.96391289, 0.96732888, 0.97057773,
41 0.97365889, 0.97657181, 0.97931600, 0.98189099, 0.98429632, 0.98653158,
42 0.98859639, 0.99049038, 0.99221324, 0.99376466, 0.99514438, 0.99635215,
43 0.99738778, 0.99825107, 0.99894188, 0.99946010, 0.99980562, 0.99997840,
44 0.99997840, 0.99980562, 0.99946010, 0.99894188, 0.99825107, 0.99738778,
45 0.99635215, 0.99514438, 0.99376466, 0.99221324, 0.99049038, 0.98859639,
46 0.98653158, 0.98429632, 0.98189099, 0.97931600, 0.97657181, 0.97365889,
47 0.97057773, 0.96732888, 0.96391289, 0.96033035, 0.95658189, 0.95266814,
48 0.94858979, 0.94434755, 0.93994213, 0.93537432, 0.93064488, 0.92575465,
49 0.92070447, 0.91549520, 0.91012776, 0.90460306, 0.89892206, 0.89308574,
50 0.88709512, 0.88095122, 0.87465511, 0.86820787, 0.86161063, 0.85486451,
51 0.84797069, 0.84093036, 0.83374472, 0.82641504, 0.81894256, 0.81132858,
52 0.80357442, 0.79568142, 0.78765094, 0.77948437, 0.77118312, 0.76274862,
53 0.75418233, 0.74548573, 0.73666033, 0.72770765, 0.71862923, 0.70942664,
54 0.70010148, 0.69065536, 0.68108990, 0.67140676, 0.66160761, 0.65169416,
55 0.64166810, 0.63153117, 0.62128512, 0.61093173, 0.60047278, 0.58991008,
56 0.57924546, 0.56848075, 0.55761782, 0.54665854, 0.53560481, 0.52445853,
57 0.51322164, 0.50189608, 0.49048379, 0.47898676, 0.46740697, 0.45574642,
58 0.44400713, 0.43219112, 0.42030043, 0.40833713, 0.39630327, 0.38420093,
59 0.37203222, 0.35979922, 0.34750406, 0.33514885, 0.32273574, 0.31026687,
60 0.29774438, 0.28517045, 0.27254725, 0.25987696, 0.24716177, 0.23440387,
61 0.22160547, 0.20876878, 0.19589602, 0.18298941, 0.17005118, 0.15708358,
62 0.14408883, 0.13106918, 0.11802689, 0.10496421, 0.09188339, 0.07878670,
63 0.06567639, 0.05255473, 0.03942400, 0.02628645, 0.01314436, 0.00000000
64 };
65
66 static const int kFilterOrder = 2;
67 static const float kCoeffNumerator[kFilterOrder + 1] = {0.974827f, -1.949650f,
68 0.974827f};
69 static const float kCoeffDenominator[kFilterOrder + 1] = {1.0f, -1.971999f,
70 0.972457f};
71
72 static_assert(kFilterOrder + 1 ==
73 sizeof(kCoeffNumerator) / sizeof(kCoeffNumerator[0]),
74 "numerator coefficients incorrect size");
75 static_assert(kFilterOrder + 1 ==
76 sizeof(kCoeffDenominator) / sizeof(kCoeffDenominator[0]),
77 "denominator coefficients incorrect size");
78
79 } // namespace webrtc
80
81 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AUDIO_PROCESSING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698