• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /*                                                                                  */
20 /*    Includes                                                                      */
21 /*                                                                                  */
22 /************************************************************************************/
23 
24 #include "LVDBE.h"
25 #include "LVDBE_Coeffs.h" /* Filter coefficients */
26 #include "LVDBE_Tables.h"
27 #include "BIQUAD.h"
28 
29 /************************************************************************************/
30 /*                                                                                  */
31 /*    Coefficients constant table                                                   */
32 /*                                                                                  */
33 /************************************************************************************/
34 
35 /*
36  * High Pass Filter Coefficient table
37  */
38 const BQ_FLOAT_Coefs_t LVDBE_HPF_Table[] = {
39         /* Coefficients for 55Hz centre frequency */
40         {HPF_Fs8000_Fc55_A2, /* 8kS/s coefficients */
41          HPF_Fs8000_Fc55_A1, HPF_Fs8000_Fc55_A0, -HPF_Fs8000_Fc55_B2, -HPF_Fs8000_Fc55_B1},
42         {HPF_Fs11025_Fc55_A2, /* 11kS/s coefficients */
43          HPF_Fs11025_Fc55_A1, HPF_Fs11025_Fc55_A0, -HPF_Fs11025_Fc55_B2, -HPF_Fs11025_Fc55_B1},
44         {HPF_Fs12000_Fc55_A2, /* 12kS/s coefficients */
45          HPF_Fs12000_Fc55_A1, HPF_Fs12000_Fc55_A0, -HPF_Fs12000_Fc55_B2, -HPF_Fs12000_Fc55_B1},
46         {HPF_Fs16000_Fc55_A2, /* 16kS/s coefficients */
47          HPF_Fs16000_Fc55_A1, HPF_Fs16000_Fc55_A0, -HPF_Fs16000_Fc55_B2, -HPF_Fs16000_Fc55_B1},
48         {HPF_Fs22050_Fc55_A2, /* 22kS/s coefficients */
49          HPF_Fs22050_Fc55_A1, HPF_Fs22050_Fc55_A0, -HPF_Fs22050_Fc55_B2, -HPF_Fs22050_Fc55_B1},
50         {HPF_Fs24000_Fc55_A2, /* 24kS/s coefficients */
51          HPF_Fs24000_Fc55_A1, HPF_Fs24000_Fc55_A0, -HPF_Fs24000_Fc55_B2, -HPF_Fs24000_Fc55_B1},
52         {HPF_Fs32000_Fc55_A2, /* 32kS/s coefficients */
53          HPF_Fs32000_Fc55_A1, HPF_Fs32000_Fc55_A0, -HPF_Fs32000_Fc55_B2, -HPF_Fs32000_Fc55_B1},
54         {HPF_Fs44100_Fc55_A2, /* 44kS/s coefficients */
55          HPF_Fs44100_Fc55_A1, HPF_Fs44100_Fc55_A0, -HPF_Fs44100_Fc55_B2, -HPF_Fs44100_Fc55_B1},
56         {HPF_Fs48000_Fc55_A2, /* 48kS/s coefficients */
57          HPF_Fs48000_Fc55_A1, HPF_Fs48000_Fc55_A0, -HPF_Fs48000_Fc55_B2, -HPF_Fs48000_Fc55_B1},
58         {HPF_Fs88200_Fc55_A2, /* 88kS/s coefficients */
59          HPF_Fs88200_Fc55_A1, HPF_Fs88200_Fc55_A0, -HPF_Fs88200_Fc55_B2, -HPF_Fs88200_Fc55_B1},
60         {HPF_Fs96000_Fc55_A2, /* 96kS/s coefficients */
61          HPF_Fs96000_Fc55_A1, HPF_Fs96000_Fc55_A0, -HPF_Fs96000_Fc55_B2, -HPF_Fs96000_Fc55_B1},
62         {HPF_Fs176400_Fc55_A2, /* 176kS/s coefficients */
63          HPF_Fs176400_Fc55_A1, HPF_Fs176400_Fc55_A0, -HPF_Fs176400_Fc55_B2, -HPF_Fs176400_Fc55_B1},
64         {HPF_Fs192000_Fc55_A2, /* 192kS/s coefficients */
65          HPF_Fs192000_Fc55_A1, HPF_Fs192000_Fc55_A0, -HPF_Fs192000_Fc55_B2, -HPF_Fs192000_Fc55_B1},
66 
67         /* Coefficients for 66Hz centre frequency */
68         {HPF_Fs8000_Fc66_A2, /* 8kS/s coefficients */
69          HPF_Fs8000_Fc66_A1, HPF_Fs8000_Fc66_A0, -HPF_Fs8000_Fc66_B2, -HPF_Fs8000_Fc66_B1},
70         {HPF_Fs11025_Fc66_A2, /* 11kS/s coefficients */
71          HPF_Fs11025_Fc66_A1, HPF_Fs11025_Fc66_A0, -HPF_Fs11025_Fc66_B2, -HPF_Fs11025_Fc66_B1},
72         {HPF_Fs12000_Fc66_A2, /* 12kS/s coefficients */
73          HPF_Fs12000_Fc66_A1, HPF_Fs12000_Fc66_A0, -HPF_Fs12000_Fc66_B2, -HPF_Fs12000_Fc66_B1},
74         {HPF_Fs16000_Fc66_A2, /* 16kS/s coefficients */
75          HPF_Fs16000_Fc66_A1, HPF_Fs16000_Fc66_A0, -HPF_Fs16000_Fc66_B2, -HPF_Fs16000_Fc66_B1},
76         {HPF_Fs22050_Fc66_A2, /* 22kS/s coefficients */
77          HPF_Fs22050_Fc66_A1, HPF_Fs22050_Fc66_A0, -HPF_Fs22050_Fc66_B2, -HPF_Fs22050_Fc66_B1},
78         {HPF_Fs24000_Fc66_A2, /* 24kS/s coefficients */
79          HPF_Fs24000_Fc66_A1, HPF_Fs24000_Fc66_A0, -HPF_Fs24000_Fc66_B2, -HPF_Fs24000_Fc66_B1},
80         {HPF_Fs32000_Fc66_A2, /* 32kS/s coefficients */
81          HPF_Fs32000_Fc66_A1, HPF_Fs32000_Fc66_A0, -HPF_Fs32000_Fc66_B2, -HPF_Fs32000_Fc66_B1},
82         {HPF_Fs44100_Fc66_A2, /* 44kS/s coefficients */
83          HPF_Fs44100_Fc66_A1, HPF_Fs44100_Fc66_A0, -HPF_Fs44100_Fc66_B2, -HPF_Fs44100_Fc66_B1},
84         {HPF_Fs48000_Fc66_A2, /* 48kS/s coefficients */
85          HPF_Fs48000_Fc66_A1, HPF_Fs48000_Fc66_A0, -HPF_Fs48000_Fc66_B2, -HPF_Fs48000_Fc66_B1},
86         {HPF_Fs88200_Fc66_A2, /* 88kS/s coefficients */
87          HPF_Fs88200_Fc66_A1, HPF_Fs88200_Fc66_A0, -HPF_Fs88200_Fc66_B2, -HPF_Fs88200_Fc66_B1},
88         {HPF_Fs96000_Fc66_A2, /* 96kS/s coefficients */
89          HPF_Fs96000_Fc66_A1, HPF_Fs96000_Fc66_A0, -HPF_Fs96000_Fc66_B2, -HPF_Fs96000_Fc66_B1},
90         {HPF_Fs176400_Fc66_A2, /* 176kS/s coefficients */
91          HPF_Fs176400_Fc66_A1, HPF_Fs176400_Fc66_A0, -HPF_Fs176400_Fc66_B2, -HPF_Fs176400_Fc66_B1},
92         {HPF_Fs192000_Fc66_A2, /* 192kS/s coefficients */
93          HPF_Fs192000_Fc66_A1, HPF_Fs192000_Fc66_A0, -HPF_Fs192000_Fc66_B2, -HPF_Fs192000_Fc66_B1},
94 
95         /* Coefficients for 78Hz centre frequency */
96         {HPF_Fs8000_Fc78_A2, /* 8kS/s coefficients */
97          HPF_Fs8000_Fc78_A1, HPF_Fs8000_Fc78_A0, -HPF_Fs8000_Fc78_B2, -HPF_Fs8000_Fc78_B1},
98         {HPF_Fs11025_Fc78_A2, /* 11kS/s coefficients */
99          HPF_Fs11025_Fc78_A1, HPF_Fs11025_Fc78_A0, -HPF_Fs11025_Fc78_B2, -HPF_Fs11025_Fc78_B1},
100         {HPF_Fs12000_Fc78_A2, /* 12kS/s coefficients */
101          HPF_Fs12000_Fc78_A1, HPF_Fs12000_Fc78_A0, -HPF_Fs12000_Fc78_B2, -HPF_Fs12000_Fc78_B1},
102         {HPF_Fs16000_Fc78_A2, /* 16kS/s coefficients */
103          HPF_Fs16000_Fc78_A1, HPF_Fs16000_Fc78_A0, -HPF_Fs16000_Fc78_B2, -HPF_Fs16000_Fc78_B1},
104         {HPF_Fs22050_Fc78_A2, /* 22kS/s coefficients */
105          HPF_Fs22050_Fc78_A1, HPF_Fs22050_Fc78_A0, -HPF_Fs22050_Fc78_B2, -HPF_Fs22050_Fc78_B1},
106         {HPF_Fs24000_Fc78_A2, /* 24kS/s coefficients */
107          HPF_Fs24000_Fc78_A1, HPF_Fs24000_Fc78_A0, -HPF_Fs24000_Fc78_B2, -HPF_Fs24000_Fc78_B1},
108         {HPF_Fs32000_Fc78_A2, /* 32kS/s coefficients */
109          HPF_Fs32000_Fc78_A1, HPF_Fs32000_Fc78_A0, -HPF_Fs32000_Fc78_B2, -HPF_Fs32000_Fc78_B1},
110         {HPF_Fs44100_Fc78_A2, /* 44kS/s coefficients */
111          HPF_Fs44100_Fc78_A1, HPF_Fs44100_Fc78_A0, -HPF_Fs44100_Fc78_B2, -HPF_Fs44100_Fc78_B1},
112         {HPF_Fs48000_Fc78_A2, /* 48kS/s coefficients */
113          HPF_Fs48000_Fc78_A1, HPF_Fs48000_Fc78_A0, -HPF_Fs48000_Fc78_B2, -HPF_Fs48000_Fc78_B1},
114         {HPF_Fs88200_Fc78_A2, /* 88kS/s coefficients */
115          HPF_Fs88200_Fc78_A1, HPF_Fs88200_Fc78_A0, -HPF_Fs88200_Fc78_B2, -HPF_Fs88200_Fc78_B1},
116         {HPF_Fs96000_Fc78_A2, /* 96kS/s coefficients */
117          HPF_Fs96000_Fc78_A1, HPF_Fs96000_Fc78_A0, -HPF_Fs96000_Fc78_B2, -HPF_Fs96000_Fc78_B1},
118         {HPF_Fs176400_Fc78_A2, /* 176kS/s coefficients */
119          HPF_Fs176400_Fc78_A1, HPF_Fs176400_Fc78_A0, -HPF_Fs176400_Fc78_B2, -HPF_Fs176400_Fc78_B1},
120         {HPF_Fs192000_Fc78_A2, /* 192kS/s coefficients */
121          HPF_Fs192000_Fc78_A1, HPF_Fs192000_Fc78_A0, -HPF_Fs192000_Fc78_B2, -HPF_Fs192000_Fc78_B1},
122 
123         /* Coefficients for 90Hz centre frequency */
124         {HPF_Fs8000_Fc90_A2, /* 8kS/s coefficients */
125          HPF_Fs8000_Fc90_A1, HPF_Fs8000_Fc90_A0, -HPF_Fs8000_Fc90_B2, -HPF_Fs8000_Fc90_B1},
126         {HPF_Fs11025_Fc90_A2, /* 11kS/s coefficients */
127          HPF_Fs11025_Fc90_A1, HPF_Fs11025_Fc90_A0, -HPF_Fs11025_Fc90_B2, -HPF_Fs11025_Fc90_B1},
128         {HPF_Fs12000_Fc90_A2, /* 12kS/s coefficients */
129          HPF_Fs12000_Fc90_A1, HPF_Fs12000_Fc90_A0, -HPF_Fs12000_Fc90_B2, -HPF_Fs12000_Fc90_B1},
130         {HPF_Fs16000_Fc90_A2, /* 16kS/s coefficients */
131          HPF_Fs16000_Fc90_A1, HPF_Fs16000_Fc90_A0, -HPF_Fs16000_Fc90_B2, -HPF_Fs16000_Fc90_B1},
132         {HPF_Fs22050_Fc90_A2, /* 22kS/s coefficients */
133          HPF_Fs22050_Fc90_A1, HPF_Fs22050_Fc90_A0, -HPF_Fs22050_Fc90_B2, -HPF_Fs22050_Fc90_B1},
134         {HPF_Fs24000_Fc90_A2, /* 24kS/s coefficients */
135          HPF_Fs24000_Fc90_A1, HPF_Fs24000_Fc90_A0, -HPF_Fs24000_Fc90_B2, -HPF_Fs24000_Fc90_B1},
136         {HPF_Fs32000_Fc90_A2, /* 32kS/s coefficients */
137          HPF_Fs32000_Fc90_A1, HPF_Fs32000_Fc90_A0, -HPF_Fs32000_Fc90_B2, -HPF_Fs32000_Fc90_B1},
138         {HPF_Fs44100_Fc90_A2, /* 44kS/s coefficients */
139          HPF_Fs44100_Fc90_A1, HPF_Fs44100_Fc90_A0, -HPF_Fs44100_Fc90_B2, -HPF_Fs44100_Fc90_B1},
140         {HPF_Fs48000_Fc90_A2, /* 48kS/s coefficients */
141          HPF_Fs48000_Fc90_A1, HPF_Fs48000_Fc90_A0, -HPF_Fs48000_Fc90_B2, -HPF_Fs48000_Fc90_B1}
142 
143         ,
144         {HPF_Fs88200_Fc90_A2, /* 88kS/s coefficients */
145          HPF_Fs88200_Fc90_A1, HPF_Fs88200_Fc90_A0, -HPF_Fs88200_Fc90_B2, -HPF_Fs88200_Fc90_B1},
146         {HPF_Fs96000_Fc90_A2, /* 96kS/s coefficients */
147          HPF_Fs96000_Fc90_A1, HPF_Fs96000_Fc90_A0, -HPF_Fs96000_Fc90_B2, -HPF_Fs96000_Fc90_B1},
148         {HPF_Fs176400_Fc90_A2, /* 176kS/s coefficients */
149          HPF_Fs176400_Fc90_A1, HPF_Fs176400_Fc90_A0, -HPF_Fs176400_Fc90_B2, -HPF_Fs176400_Fc90_B1},
150         {HPF_Fs192000_Fc90_A2, /* 192kS/s coefficients */
151          HPF_Fs192000_Fc90_A1, HPF_Fs192000_Fc90_A0, -HPF_Fs192000_Fc90_B2, -HPF_Fs192000_Fc90_B1}
152 
153 };
154 
155 /*
156  * Band Pass Filter coefficient table
157  */
158 const BP_FLOAT_Coefs_t LVDBE_BPF_Table[] = {
159         /* Coefficients for 55Hz centre frequency */
160         {BPF_Fs8000_Fc55_A0, /* 8kS/s coefficients */
161          -BPF_Fs8000_Fc55_B2, -BPF_Fs8000_Fc55_B1},
162         {BPF_Fs11025_Fc55_A0, /* 11kS/s coefficients */
163          -BPF_Fs11025_Fc55_B2, -BPF_Fs11025_Fc55_B1},
164         {BPF_Fs12000_Fc55_A0, /* 12kS/s coefficients */
165          -BPF_Fs12000_Fc55_B2, -BPF_Fs12000_Fc55_B1},
166         {BPF_Fs16000_Fc55_A0, /* 16kS/s coefficients */
167          -BPF_Fs16000_Fc55_B2, -BPF_Fs16000_Fc55_B1},
168         {BPF_Fs22050_Fc55_A0, /* 22kS/s coefficients */
169          -BPF_Fs22050_Fc55_B2, -BPF_Fs22050_Fc55_B1},
170         {BPF_Fs24000_Fc55_A0, /* 24kS/s coefficients */
171          -BPF_Fs24000_Fc55_B2, -BPF_Fs24000_Fc55_B1},
172         {BPF_Fs32000_Fc55_A0, /* 32kS/s coefficients */
173          -BPF_Fs32000_Fc55_B2, -BPF_Fs32000_Fc55_B1},
174         {BPF_Fs44100_Fc55_A0, /* 44kS/s coefficients */
175          -BPF_Fs44100_Fc55_B2, -BPF_Fs44100_Fc55_B1},
176         {BPF_Fs48000_Fc55_A0, /* 48kS/s coefficients */
177          -BPF_Fs48000_Fc55_B2, -BPF_Fs48000_Fc55_B1},
178         {BPF_Fs88200_Fc55_A0, /* 88kS/s coefficients */
179          -BPF_Fs88200_Fc55_B2, -BPF_Fs88200_Fc55_B1},
180         {BPF_Fs96000_Fc55_A0, /* 96kS/s coefficients */
181          -BPF_Fs96000_Fc55_B2, -BPF_Fs96000_Fc55_B1},
182         {BPF_Fs176400_Fc55_A0, /* 176kS/s coefficients */
183          -BPF_Fs176400_Fc55_B2, -BPF_Fs176400_Fc55_B1},
184         {BPF_Fs192000_Fc55_A0, /* 192kS/s coefficients */
185          -BPF_Fs192000_Fc55_B2, -BPF_Fs192000_Fc55_B1},
186 
187         /* Coefficients for 66Hz centre frequency */
188         {BPF_Fs8000_Fc66_A0, /* 8kS/s coefficients */
189          -BPF_Fs8000_Fc66_B2, -BPF_Fs8000_Fc66_B1},
190         {BPF_Fs11025_Fc66_A0, /* 11kS/s coefficients */
191          -BPF_Fs11025_Fc66_B2, -BPF_Fs11025_Fc66_B1},
192         {BPF_Fs12000_Fc66_A0, /* 12kS/s coefficients */
193          -BPF_Fs12000_Fc66_B2, -BPF_Fs12000_Fc66_B1},
194         {BPF_Fs16000_Fc66_A0, /* 16kS/s coefficients */
195          -BPF_Fs16000_Fc66_B2, -BPF_Fs16000_Fc66_B1},
196         {BPF_Fs22050_Fc66_A0, /* 22kS/s coefficients */
197          -BPF_Fs22050_Fc66_B2, -BPF_Fs22050_Fc66_B1},
198         {BPF_Fs24000_Fc66_A0, /* 24kS/s coefficients */
199          -BPF_Fs24000_Fc66_B2, -BPF_Fs24000_Fc66_B1},
200         {BPF_Fs32000_Fc66_A0, /* 32kS/s coefficients */
201          -BPF_Fs32000_Fc66_B2, -BPF_Fs32000_Fc66_B1},
202         {BPF_Fs44100_Fc66_A0, /* 44kS/s coefficients */
203          -BPF_Fs44100_Fc66_B2, -BPF_Fs44100_Fc66_B1},
204         {BPF_Fs48000_Fc66_A0, /* 48kS/s coefficients */
205          -BPF_Fs48000_Fc66_B2, -BPF_Fs48000_Fc66_B1},
206         {BPF_Fs88200_Fc66_A0, /* 88kS/s coefficients */
207          -BPF_Fs88200_Fc66_B2, -BPF_Fs88200_Fc66_B1},
208         {BPF_Fs96000_Fc66_A0, /* 96kS/s coefficients */
209          -BPF_Fs96000_Fc66_B2, -BPF_Fs96000_Fc66_B1},
210         {BPF_Fs176400_Fc66_A0, /* 176kS/s coefficients */
211          -BPF_Fs176400_Fc66_B2, -BPF_Fs176400_Fc66_B1},
212         {BPF_Fs192000_Fc66_A0, /* 192kS/s coefficients */
213          -BPF_Fs192000_Fc66_B2, -BPF_Fs192000_Fc66_B1},
214 
215         /* Coefficients for 78Hz centre frequency */
216         {BPF_Fs8000_Fc78_A0, /* 8kS/s coefficients */
217          -BPF_Fs8000_Fc78_B2, -BPF_Fs8000_Fc78_B1},
218         {BPF_Fs11025_Fc78_A0, /* 11kS/s coefficients */
219          -BPF_Fs11025_Fc78_B2, -BPF_Fs11025_Fc78_B1},
220         {BPF_Fs12000_Fc78_A0, /* 12kS/s coefficients */
221          -BPF_Fs12000_Fc78_B2, -BPF_Fs12000_Fc78_B1},
222         {BPF_Fs16000_Fc78_A0, /* 16kS/s coefficients */
223          -BPF_Fs16000_Fc78_B2, -BPF_Fs16000_Fc78_B1},
224         {BPF_Fs22050_Fc78_A0, /* 22kS/s coefficients */
225          -BPF_Fs22050_Fc78_B2, -BPF_Fs22050_Fc78_B1},
226         {BPF_Fs24000_Fc78_A0, /* 24kS/s coefficients */
227          -BPF_Fs24000_Fc78_B2, -BPF_Fs24000_Fc78_B1},
228         {BPF_Fs32000_Fc78_A0, /* 32kS/s coefficients */
229          -BPF_Fs32000_Fc78_B2, -BPF_Fs32000_Fc78_B1},
230         {BPF_Fs44100_Fc78_A0, /* 44kS/s coefficients */
231          -BPF_Fs44100_Fc78_B2, -BPF_Fs44100_Fc78_B1},
232         {BPF_Fs48000_Fc78_A0, /* 48kS/s coefficients */
233          -BPF_Fs48000_Fc78_B2, -BPF_Fs48000_Fc78_B1},
234         {BPF_Fs88200_Fc66_A0, /* 88kS/s coefficients */
235          -BPF_Fs88200_Fc66_B2, -BPF_Fs88200_Fc66_B1},
236         {BPF_Fs96000_Fc78_A0, /* 96kS/s coefficients */
237          -BPF_Fs96000_Fc78_B2, -BPF_Fs96000_Fc78_B1},
238         {BPF_Fs176400_Fc66_A0, /* 176kS/s coefficients */
239          -BPF_Fs176400_Fc66_B2, -BPF_Fs176400_Fc66_B1},
240         {BPF_Fs192000_Fc78_A0, /* 192kS/s coefficients */
241          -BPF_Fs192000_Fc78_B2, -BPF_Fs192000_Fc78_B1},
242 
243         /* Coefficients for 90Hz centre frequency */
244         {BPF_Fs8000_Fc90_A0, /* 8kS/s coefficients */
245          -BPF_Fs8000_Fc90_B2, -BPF_Fs8000_Fc90_B1},
246         {BPF_Fs11025_Fc90_A0, /* 11kS/s coefficients */
247          -BPF_Fs11025_Fc90_B2, -BPF_Fs11025_Fc90_B1},
248         {BPF_Fs12000_Fc90_A0, /* 12kS/s coefficients */
249          -BPF_Fs12000_Fc90_B2, -BPF_Fs12000_Fc90_B1},
250         {BPF_Fs16000_Fc90_A0, /* 16kS/s coefficients */
251          -BPF_Fs16000_Fc90_B2, -BPF_Fs16000_Fc90_B1},
252         {BPF_Fs22050_Fc90_A0, /* 22kS/s coefficients */
253          -BPF_Fs22050_Fc90_B2, -BPF_Fs22050_Fc90_B1},
254         {BPF_Fs24000_Fc90_A0, /* 24kS/s coefficients */
255          -BPF_Fs24000_Fc90_B2, -BPF_Fs24000_Fc90_B1},
256         {BPF_Fs32000_Fc90_A0, /* 32kS/s coefficients */
257          -BPF_Fs32000_Fc90_B2, -BPF_Fs32000_Fc90_B1},
258         {BPF_Fs44100_Fc90_A0, /* 44kS/s coefficients */
259          -BPF_Fs44100_Fc90_B2, -BPF_Fs44100_Fc90_B1},
260         {BPF_Fs48000_Fc90_A0, /* 48kS/s coefficients */
261          -BPF_Fs48000_Fc90_B2, -BPF_Fs48000_Fc90_B1},
262         {BPF_Fs88200_Fc90_A0, /* 88kS/s coefficients */
263          -BPF_Fs88200_Fc90_B2, -BPF_Fs88200_Fc90_B1},
264         {BPF_Fs96000_Fc90_A0, /* 96kS/s coefficients */
265          -BPF_Fs96000_Fc90_B2, -BPF_Fs96000_Fc90_B1},
266         {BPF_Fs176400_Fc90_A0, /* 176kS/s coefficients */
267          -BPF_Fs176400_Fc90_B2, -BPF_Fs176400_Fc90_B1},
268         {BPF_Fs192000_Fc90_A0, /* 192kS/s coefficients */
269          -BPF_Fs192000_Fc90_B2, -BPF_Fs192000_Fc90_B1}
270 
271 };
272 
273 /************************************************************************************/
274 /*                                                                                  */
275 /*    AGC constant tables                                                           */
276 /*                                                                                  */
277 /************************************************************************************/
278 
279 /* Attack time (signal too large) */
280 const LVM_FLOAT LVDBE_AGC_ATTACK_Table[] = {
281         AGC_ATTACK_Fs8000,  AGC_ATTACK_Fs11025, AGC_ATTACK_Fs12000, AGC_ATTACK_Fs16000,
282         AGC_ATTACK_Fs22050, AGC_ATTACK_Fs24000, AGC_ATTACK_Fs32000, AGC_ATTACK_Fs44100,
283         AGC_ATTACK_Fs48000, AGC_ATTACK_Fs88200, AGC_ATTACK_Fs96000, AGC_ATTACK_Fs176400,
284         AGC_ATTACK_Fs192000
285 
286 };
287 
288 /* Decay time (signal too small) */
289 const LVM_FLOAT LVDBE_AGC_DECAY_Table[] = {AGC_DECAY_Fs8000,  AGC_DECAY_Fs11025, AGC_DECAY_Fs12000,
290                                            AGC_DECAY_Fs16000, AGC_DECAY_Fs22050, AGC_DECAY_Fs24000,
291                                            AGC_DECAY_Fs32000, AGC_DECAY_Fs44100, AGC_DECAY_Fs48000,
292                                            AGC_DECAY_Fs88200, AGC_DECAY_FS96000, AGC_DECAY_Fs176400,
293                                            AGC_DECAY_FS192000
294 
295 };
296 
297 /* Gain for use without the high pass filter */
298 const LVM_FLOAT LVDBE_AGC_GAIN_Table[] = {
299         AGC_GAIN_0dB,  AGC_GAIN_1dB,  AGC_GAIN_2dB,  AGC_GAIN_3dB, AGC_GAIN_4dB,  AGC_GAIN_5dB,
300         AGC_GAIN_6dB,  AGC_GAIN_7dB,  AGC_GAIN_8dB,  AGC_GAIN_9dB, AGC_GAIN_10dB, AGC_GAIN_11dB,
301         AGC_GAIN_12dB, AGC_GAIN_13dB, AGC_GAIN_14dB, AGC_GAIN_15dB};
302 
303 /* Gain for use with the high pass filter */
304 const LVM_FLOAT LVDBE_AGC_HPFGAIN_Table[] = {
305         AGC_HPFGAIN_0dB,  AGC_HPFGAIN_1dB,  AGC_HPFGAIN_2dB,  AGC_HPFGAIN_3dB,
306         AGC_HPFGAIN_4dB,  AGC_HPFGAIN_5dB,  AGC_HPFGAIN_6dB,  AGC_HPFGAIN_7dB,
307         AGC_HPFGAIN_8dB,  AGC_HPFGAIN_9dB,  AGC_HPFGAIN_10dB, AGC_HPFGAIN_11dB,
308         AGC_HPFGAIN_12dB, AGC_HPFGAIN_13dB, AGC_HPFGAIN_14dB, AGC_HPFGAIN_15dB};
309 
310 /************************************************************************************/
311 /*                                                                                  */
312 /*    Volume control gain and time constant tables                                  */
313 /*                                                                                  */
314 /************************************************************************************/
315 
316 /* dB to linear conversion table */
317 const LVM_FLOAT LVDBE_VolumeTable[] = {0.500000f,  /* -6dB */
318                                        0.562341f,  /* -5dB */
319                                        0.630957f,  /* -4dB */
320                                        0.707946f,  /* -3dB */
321                                        0.794328f,  /* -2dB */
322                                        0.891251f,  /* -1dB */
323                                        1.000000f}; /*  0dB */
324 
325 const LVM_FLOAT LVDBE_VolumeTCTable[] = {
326         VOL_TC_Fs8000,  VOL_TC_Fs11025,  VOL_TC_Fs12000, VOL_TC_Fs16000, VOL_TC_Fs22050,
327         VOL_TC_Fs24000, VOL_TC_Fs32000,  VOL_TC_Fs44100, VOL_TC_Fs48000, VOL_TC_Fs88200,
328         VOL_TC_Fs96000, VOL_TC_Fs176400, VOL_TC_Fs192000};
329 
330 const LVM_INT16 LVDBE_MixerTCTable[] = {
331 
332         MIX_TC_Fs8000,  MIX_TC_Fs11025,  MIX_TC_Fs12000, MIX_TC_Fs16000, MIX_TC_Fs22050,
333         MIX_TC_Fs24000, MIX_TC_Fs32000,  MIX_TC_Fs44100, MIX_TC_Fs48000, MIX_TC_Fs88200,
334         MIX_TC_Fs96000, MIX_TC_Fs176400, MIX_TC_Fs192000
335 
336 };
337