1 /* 2 * Copyright (C) 2004-2010 NXP Software 3 * Copyright (C) 2010 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 19 #ifndef __LVEQNB_COEFFS_H__ 20 #define __LVEQNB_COEFFS_H__ 21 22 23 /************************************************************************************/ 24 /* */ 25 /* Gain table for (10^(Gain/20) - 1) */ 26 /* */ 27 /************************************************************************************/ 28 29 #define LVEQNB_GAINSHIFT 11 /* As a power of 2 */ 30 #define LVEQNB_Gain_Neg15_dB -1684 /* Floating point value -0.822172 */ 31 #define LVEQNB_Gain_Neg14_dB -1639 /* Floating point value -0.800474 */ 32 #define LVEQNB_Gain_Neg13_dB -1590 /* Floating point value -0.776128 */ 33 #define LVEQNB_Gain_Neg12_dB -1534 /* Floating point value -0.748811 */ 34 #define LVEQNB_Gain_Neg11_dB -1471 /* Floating point value -0.718162 */ 35 #define LVEQNB_Gain_Neg10_dB -1400 /* Floating point value -0.683772 */ 36 #define LVEQNB_Gain_Neg9_dB -1321 /* Floating point value -0.645187 */ 37 #define LVEQNB_Gain_Neg8_dB -1233 /* Floating point value -0.601893 */ 38 #define LVEQNB_Gain_Neg7_dB -1133 /* Floating point value -0.553316 */ 39 #define LVEQNB_Gain_Neg6_dB -1022 /* Floating point value -0.498813 */ 40 #define LVEQNB_Gain_Neg5_dB -896 /* Floating point value -0.437659 */ 41 #define LVEQNB_Gain_Neg4_dB -756 /* Floating point value -0.369043 */ 42 #define LVEQNB_Gain_Neg3_dB -598 /* Floating point value -0.292054 */ 43 #define LVEQNB_Gain_Neg2_dB -421 /* Floating point value -0.205672 */ 44 #define LVEQNB_Gain_Neg1_dB -223 /* Floating point value -0.108749 */ 45 #define LVEQNB_Gain_0_dB 0 /* Floating point value 0.000000 */ 46 #define LVEQNB_Gain_1_dB 250 /* Floating point value 0.122018 */ 47 #define LVEQNB_Gain_2_dB 530 /* Floating point value 0.258925 */ 48 #define LVEQNB_Gain_3_dB 845 /* Floating point value 0.412538 */ 49 #define LVEQNB_Gain_4_dB 1198 /* Floating point value 0.584893 */ 50 #define LVEQNB_Gain_5_dB 1594 /* Floating point value 0.778279 */ 51 #define LVEQNB_Gain_6_dB 2038 /* Floating point value 0.995262 */ 52 #define LVEQNB_Gain_7_dB 2537 /* Floating point value 1.238721 */ 53 #define LVEQNB_Gain_8_dB 3096 /* Floating point value 1.511886 */ 54 #define LVEQNB_Gain_9_dB 3724 /* Floating point value 1.818383 */ 55 #define LVEQNB_Gain_10_dB 4428 /* Floating point value 2.162278 */ 56 #define LVEQNB_Gain_11_dB 5219 /* Floating point value 2.548134 */ 57 #define LVEQNB_Gain_12_dB 6105 /* Floating point value 2.981072 */ 58 #define LVEQNB_Gain_13_dB 7100 /* Floating point value 3.466836 */ 59 #define LVEQNB_Gain_14_dB 8216 /* Floating point value 4.011872 */ 60 #define LVEQNB_Gain_15_dB 9469 /* Floating point value 4.623413 */ 61 62 63 /************************************************************************************/ 64 /* */ 65 /* Frequency table for 2*Pi/Fs */ 66 /* */ 67 /************************************************************************************/ 68 69 #define LVEQNB_FREQSHIFT 25 /* As a power of 2 */ 70 #define LVEQNB_2PiOn_8000 26354 /* Floating point value 0.000785 */ 71 #define LVEQNB_2PiOn_11025 19123 /* Floating point value 0.000570 */ 72 #define LVEQNB_2PiOn_12000 17569 /* Floating point value 0.000524 */ 73 #define LVEQNB_2PiOn_16000 13177 /* Floating point value 0.000393 */ 74 #define LVEQNB_2PiOn_22050 9561 /* Floating point value 0.000285 */ 75 #define LVEQNB_2PiOn_24000 8785 /* Floating point value 0.000262 */ 76 #define LVEQNB_2PiOn_32000 6588 /* Floating point value 0.000196 */ 77 #define LVEQNB_2PiOn_44100 4781 /* Floating point value 0.000142 */ 78 #define LVEQNB_2PiOn_48000 4392 /* Floating point value 0.000131 */ 79 80 81 /************************************************************************************/ 82 /* */ 83 /* 50D table for 50 / ( 1 + Gain ) */ 84 /* */ 85 /************************************************************************************/ 86 87 #define LVEQNB_100DSHIFT 5 /* As a power of 2 */ 88 #define LVEQNB_100D_Neg15_dB 17995 /* Floating point value 5.623413 */ 89 #define LVEQNB_100D_Neg14_dB 16038 /* Floating point value 5.011872 */ 90 #define LVEQNB_100D_Neg13_dB 14294 /* Floating point value 4.466836 */ 91 #define LVEQNB_100D_Neg12_dB 12739 /* Floating point value 3.981072 */ 92 #define LVEQNB_100D_Neg11_dB 11354 /* Floating point value 3.548134 */ 93 #define LVEQNB_100D_Neg10_dB 10119 /* Floating point value 3.162278 */ 94 #define LVEQNB_100D_Neg9_dB 9019 /* Floating point value 2.818383 */ 95 #define LVEQNB_100D_Neg8_dB 8038 /* Floating point value 2.511886 */ 96 #define LVEQNB_100D_Neg7_dB 7164 /* Floating point value 2.238721 */ 97 #define LVEQNB_100D_Neg6_dB 6385 /* Floating point value 1.995262 */ 98 #define LVEQNB_100D_Neg5_dB 5690 /* Floating point value 1.778279 */ 99 #define LVEQNB_100D_Neg4_dB 5072 /* Floating point value 1.584893 */ 100 #define LVEQNB_100D_Neg3_dB 4520 /* Floating point value 1.412538 */ 101 #define LVEQNB_100D_Neg2_dB 4029 /* Floating point value 1.258925 */ 102 #define LVEQNB_100D_Neg1_dB 3590 /* Floating point value 1.122018 */ 103 #define LVEQNB_100D_0_dB 3200 /* Floating point value 1.000000 */ 104 105 106 #endif 107