1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __LVEQNB_TABLES_H__ 18 #define __LVEQNB_TABLES_H__ 19 20 /************************************************************************************/ 21 /* */ 22 /* Sample rate table */ 23 /* */ 24 /************************************************************************************/ 25 26 /* 27 * Sample rate table for converting between the enumerated type and the actual 28 * frequency 29 */ 30 extern const LVM_UINT32 LVEQNB_SampleRateTab[]; 31 32 /************************************************************************************/ 33 /* */ 34 /* Coefficient calculation tables */ 35 /* */ 36 /************************************************************************************/ 37 38 /* 39 * Table for 2 * Pi / Fs 40 */ 41 extern const LVM_FLOAT LVEQNB_TwoPiOnFsTable[]; 42 43 /* 44 * Gain table 45 */ 46 extern const LVM_FLOAT LVEQNB_GainTable[]; 47 48 /* 49 * D table for 100 / (Gain + 1) 50 */ 51 extern const LVM_FLOAT LVEQNB_DTable[]; 52 53 /************************************************************************************/ 54 /* */ 55 /* Filter polynomial coefficients */ 56 /* */ 57 /************************************************************************************/ 58 59 /* 60 * Coefficients for calculating the cosine with the equation: 61 * 62 * Cos(x) = (2^Shifts)*(a0 + a1*x + a2*x^2 + a3*x^3 + a4*x^4 + a5*x^5) 63 * 64 * These coefficients expect the input, x, to be in the range 0 to 32768 respresenting 65 * a range of 0 to Pi. The output is in the range 32767 to -32768 representing the range 66 * +1.0 to -1.0 67 */ 68 extern const LVM_INT16 LVEQNB_CosCoef[]; 69 70 /* 71 * Coefficients for calculating the cosine error with the equation: 72 * 73 * CosErr(x) = (2^Shifts)*(a0 + a1*x + a2*x^2 + a3*x^3) 74 * 75 * These coefficients expect the input, x, to be in the range 0 to 32768 respresenting 76 * a range of 0 to Pi/25. The output is in the range 0 to 32767 representing the range 77 * 0.0 to 0.0078852986 78 * 79 * This is used to give a double precision cosine over the range 0 to Pi/25 using the 80 * the equation: 81 * 82 * Cos(x) = 1.0 - CosErr(x) 83 */ 84 extern const LVM_INT16 LVEQNB_DPCosCoef[]; 85 86 #endif /* __LVEQNB_TABLES_H__ */ 87