• Home
  • History
  • Annotate
  • 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  /*                                                                                  */
21  /*    Includes                                                                      */
22  /*                                                                                  */
23  /************************************************************************************/
24  
25  #include "LVDBE.h"
26  #include "LVDBE_Coeffs.h"               /* Filter coefficients */
27  #include "BIQUAD.h"
28  
29  
30  /************************************************************************************/
31  /*                                                                                  */
32  /*    Coefficients constant table                                                   */
33  /*                                                                                  */
34  /************************************************************************************/
35  
36  /*
37   * High Pass Filter Coefficient table
38   */
39  #ifndef BUILD_FLOAT
40  const BQ_C32_Coefs_t LVDBE_HPF_Table[] = {
41  #else /*BUILD_FLOAT*/
42  const BQ_FLOAT_Coefs_t LVDBE_HPF_Table[] = {
43  #endif /*BUILD_FLOAT*/
44      /* Coefficients for 55Hz centre frequency */
45      {HPF_Fs8000_Fc55_A2,                /* 8kS/s coefficients */
46       HPF_Fs8000_Fc55_A1,
47       HPF_Fs8000_Fc55_A0,
48       -HPF_Fs8000_Fc55_B2,
49       -HPF_Fs8000_Fc55_B1},
50      {HPF_Fs11025_Fc55_A2,                /* 11kS/s coefficients */
51       HPF_Fs11025_Fc55_A1,
52       HPF_Fs11025_Fc55_A0,
53       -HPF_Fs11025_Fc55_B2,
54       -HPF_Fs11025_Fc55_B1},
55      {HPF_Fs12000_Fc55_A2,                /* 12kS/s coefficients */
56       HPF_Fs12000_Fc55_A1,
57       HPF_Fs12000_Fc55_A0,
58       -HPF_Fs12000_Fc55_B2,
59       -HPF_Fs12000_Fc55_B1},
60      {HPF_Fs16000_Fc55_A2,                /* 16kS/s coefficients */
61       HPF_Fs16000_Fc55_A1,
62       HPF_Fs16000_Fc55_A0,
63       -HPF_Fs16000_Fc55_B2,
64       -HPF_Fs16000_Fc55_B1},
65      {HPF_Fs22050_Fc55_A2,                /* 22kS/s coefficients */
66       HPF_Fs22050_Fc55_A1,
67       HPF_Fs22050_Fc55_A0,
68       -HPF_Fs22050_Fc55_B2,
69       -HPF_Fs22050_Fc55_B1},
70      {HPF_Fs24000_Fc55_A2,                /* 24kS/s coefficients */
71       HPF_Fs24000_Fc55_A1,
72       HPF_Fs24000_Fc55_A0,
73       -HPF_Fs24000_Fc55_B2,
74       -HPF_Fs24000_Fc55_B1},
75      {HPF_Fs32000_Fc55_A2,                /* 32kS/s coefficients */
76       HPF_Fs32000_Fc55_A1,
77       HPF_Fs32000_Fc55_A0,
78       -HPF_Fs32000_Fc55_B2,
79       -HPF_Fs32000_Fc55_B1},
80      {HPF_Fs44100_Fc55_A2,                /* 44kS/s coefficients */
81       HPF_Fs44100_Fc55_A1,
82       HPF_Fs44100_Fc55_A0,
83       -HPF_Fs44100_Fc55_B2,
84       -HPF_Fs44100_Fc55_B1},
85      {HPF_Fs48000_Fc55_A2,                /* 48kS/s coefficients */
86       HPF_Fs48000_Fc55_A1,
87       HPF_Fs48000_Fc55_A0,
88       -HPF_Fs48000_Fc55_B2,
89       -HPF_Fs48000_Fc55_B1},
90  #ifdef HIGHER_FS
91      {HPF_Fs88200_Fc55_A2,                /* 88kS/s coefficients */
92       HPF_Fs88200_Fc55_A1,
93       HPF_Fs88200_Fc55_A0,
94       -HPF_Fs88200_Fc55_B2,
95       -HPF_Fs88200_Fc55_B1},
96      {HPF_Fs96000_Fc55_A2,                /* 96kS/s coefficients */
97       HPF_Fs96000_Fc55_A1,
98       HPF_Fs96000_Fc55_A0,
99       -HPF_Fs96000_Fc55_B2,
100       -HPF_Fs96000_Fc55_B1},
101      {HPF_Fs176400_Fc55_A2,                /* 176kS/s coefficients */
102       HPF_Fs176400_Fc55_A1,
103       HPF_Fs176400_Fc55_A0,
104       -HPF_Fs176400_Fc55_B2,
105       -HPF_Fs176400_Fc55_B1},
106      {HPF_Fs192000_Fc55_A2,                /* 192kS/s coefficients */
107       HPF_Fs192000_Fc55_A1,
108       HPF_Fs192000_Fc55_A0,
109       -HPF_Fs192000_Fc55_B2,
110       -HPF_Fs192000_Fc55_B1},
111  #endif
112  
113      /* Coefficients for 66Hz centre frequency */
114      {HPF_Fs8000_Fc66_A2,                /* 8kS/s coefficients */
115       HPF_Fs8000_Fc66_A1,
116       HPF_Fs8000_Fc66_A0,
117       -HPF_Fs8000_Fc66_B2,
118       -HPF_Fs8000_Fc66_B1},
119      {HPF_Fs11025_Fc66_A2,                /* 11kS/s coefficients */
120       HPF_Fs11025_Fc66_A1,
121       HPF_Fs11025_Fc66_A0,
122       -HPF_Fs11025_Fc66_B2,
123       -HPF_Fs11025_Fc66_B1},
124      {HPF_Fs12000_Fc66_A2,                /* 12kS/s coefficients */
125       HPF_Fs12000_Fc66_A1,
126       HPF_Fs12000_Fc66_A0,
127       -HPF_Fs12000_Fc66_B2,
128       -HPF_Fs12000_Fc66_B1},
129      {HPF_Fs16000_Fc66_A2,                /* 16kS/s coefficients */
130       HPF_Fs16000_Fc66_A1,
131       HPF_Fs16000_Fc66_A0,
132       -HPF_Fs16000_Fc66_B2,
133       -HPF_Fs16000_Fc66_B1},
134      {HPF_Fs22050_Fc66_A2,                /* 22kS/s coefficients */
135       HPF_Fs22050_Fc66_A1,
136       HPF_Fs22050_Fc66_A0,
137       -HPF_Fs22050_Fc66_B2,
138       -HPF_Fs22050_Fc66_B1},
139      {HPF_Fs24000_Fc66_A2,                /* 24kS/s coefficients */
140       HPF_Fs24000_Fc66_A1,
141       HPF_Fs24000_Fc66_A0,
142       -HPF_Fs24000_Fc66_B2,
143       -HPF_Fs24000_Fc66_B1},
144      {HPF_Fs32000_Fc66_A2,                /* 32kS/s coefficients */
145       HPF_Fs32000_Fc66_A1,
146       HPF_Fs32000_Fc66_A0,
147       -HPF_Fs32000_Fc66_B2,
148       -HPF_Fs32000_Fc66_B1},
149      {HPF_Fs44100_Fc66_A2,                /* 44kS/s coefficients */
150       HPF_Fs44100_Fc66_A1,
151       HPF_Fs44100_Fc66_A0,
152       -HPF_Fs44100_Fc66_B2,
153       -HPF_Fs44100_Fc66_B1},
154      {HPF_Fs48000_Fc66_A2,                /* 48kS/s coefficients */
155       HPF_Fs48000_Fc66_A1,
156       HPF_Fs48000_Fc66_A0,
157       -HPF_Fs48000_Fc66_B2,
158       -HPF_Fs48000_Fc66_B1},
159  #ifdef HIGHER_FS
160      {HPF_Fs88200_Fc66_A2,                /* 88kS/s coefficients */
161       HPF_Fs88200_Fc66_A1,
162       HPF_Fs88200_Fc66_A0,
163       -HPF_Fs88200_Fc66_B2,
164       -HPF_Fs88200_Fc66_B1},
165      {HPF_Fs96000_Fc66_A2,                /* 96kS/s coefficients */
166       HPF_Fs96000_Fc66_A1,
167       HPF_Fs96000_Fc66_A0,
168       -HPF_Fs96000_Fc66_B2,
169       -HPF_Fs96000_Fc66_B1},
170      {HPF_Fs176400_Fc66_A2,                /* 176kS/s coefficients */
171       HPF_Fs176400_Fc66_A1,
172       HPF_Fs176400_Fc66_A0,
173       -HPF_Fs176400_Fc66_B2,
174       -HPF_Fs176400_Fc66_B1},
175      {HPF_Fs192000_Fc66_A2,                /* 192kS/s coefficients */
176       HPF_Fs192000_Fc66_A1,
177       HPF_Fs192000_Fc66_A0,
178       -HPF_Fs192000_Fc66_B2,
179       -HPF_Fs192000_Fc66_B1},
180  #endif
181  
182  
183      /* Coefficients for 78Hz centre frequency */
184      {HPF_Fs8000_Fc78_A2,                /* 8kS/s coefficients */
185       HPF_Fs8000_Fc78_A1,
186       HPF_Fs8000_Fc78_A0,
187       -HPF_Fs8000_Fc78_B2,
188       -HPF_Fs8000_Fc78_B1},
189      {HPF_Fs11025_Fc78_A2,                /* 11kS/s coefficients */
190       HPF_Fs11025_Fc78_A1,
191       HPF_Fs11025_Fc78_A0,
192       -HPF_Fs11025_Fc78_B2,
193       -HPF_Fs11025_Fc78_B1},
194      {HPF_Fs12000_Fc78_A2,                /* 12kS/s coefficients */
195       HPF_Fs12000_Fc78_A1,
196       HPF_Fs12000_Fc78_A0,
197       -HPF_Fs12000_Fc78_B2,
198       -HPF_Fs12000_Fc78_B1},
199      {HPF_Fs16000_Fc78_A2,                /* 16kS/s coefficients */
200       HPF_Fs16000_Fc78_A1,
201       HPF_Fs16000_Fc78_A0,
202       -HPF_Fs16000_Fc78_B2,
203       -HPF_Fs16000_Fc78_B1},
204      {HPF_Fs22050_Fc78_A2,                /* 22kS/s coefficients */
205       HPF_Fs22050_Fc78_A1,
206       HPF_Fs22050_Fc78_A0,
207       -HPF_Fs22050_Fc78_B2,
208       -HPF_Fs22050_Fc78_B1},
209      {HPF_Fs24000_Fc78_A2,                /* 24kS/s coefficients */
210       HPF_Fs24000_Fc78_A1,
211       HPF_Fs24000_Fc78_A0,
212       -HPF_Fs24000_Fc78_B2,
213       -HPF_Fs24000_Fc78_B1},
214      {HPF_Fs32000_Fc78_A2,                /* 32kS/s coefficients */
215       HPF_Fs32000_Fc78_A1,
216       HPF_Fs32000_Fc78_A0,
217       -HPF_Fs32000_Fc78_B2,
218       -HPF_Fs32000_Fc78_B1},
219      {HPF_Fs44100_Fc78_A2,                /* 44kS/s coefficients */
220       HPF_Fs44100_Fc78_A1,
221       HPF_Fs44100_Fc78_A0,
222       -HPF_Fs44100_Fc78_B2,
223       -HPF_Fs44100_Fc78_B1},
224      {HPF_Fs48000_Fc78_A2,                /* 48kS/s coefficients */
225       HPF_Fs48000_Fc78_A1,
226       HPF_Fs48000_Fc78_A0,
227       -HPF_Fs48000_Fc78_B2,
228       -HPF_Fs48000_Fc78_B1},
229  #ifdef HIGHER_FS
230      {HPF_Fs88200_Fc78_A2,                /* 88kS/s coefficients */
231       HPF_Fs88200_Fc78_A1,
232       HPF_Fs88200_Fc78_A0,
233       -HPF_Fs88200_Fc78_B2,
234       -HPF_Fs88200_Fc78_B1},
235      {HPF_Fs96000_Fc78_A2,                /* 96kS/s coefficients */
236       HPF_Fs96000_Fc78_A1,
237       HPF_Fs96000_Fc78_A0,
238       -HPF_Fs96000_Fc78_B2,
239       -HPF_Fs96000_Fc78_B1},
240      {HPF_Fs176400_Fc78_A2,                /* 176kS/s coefficients */
241       HPF_Fs176400_Fc78_A1,
242       HPF_Fs176400_Fc78_A0,
243       -HPF_Fs176400_Fc78_B2,
244       -HPF_Fs176400_Fc78_B1},
245      {HPF_Fs192000_Fc78_A2,                /* 192kS/s coefficients */
246       HPF_Fs192000_Fc78_A1,
247       HPF_Fs192000_Fc78_A0,
248       -HPF_Fs192000_Fc78_B2,
249       -HPF_Fs192000_Fc78_B1},
250  #endif
251  
252  
253      /* Coefficients for 90Hz centre frequency */
254      {HPF_Fs8000_Fc90_A2,                /* 8kS/s coefficients */
255       HPF_Fs8000_Fc90_A1,
256       HPF_Fs8000_Fc90_A0,
257       -HPF_Fs8000_Fc90_B2,
258       -HPF_Fs8000_Fc90_B1},
259      {HPF_Fs11025_Fc90_A2,                /* 11kS/s coefficients */
260       HPF_Fs11025_Fc90_A1,
261       HPF_Fs11025_Fc90_A0,
262       -HPF_Fs11025_Fc90_B2,
263       -HPF_Fs11025_Fc90_B1},
264      {HPF_Fs12000_Fc90_A2,                /* 12kS/s coefficients */
265       HPF_Fs12000_Fc90_A1,
266       HPF_Fs12000_Fc90_A0,
267       -HPF_Fs12000_Fc90_B2,
268       -HPF_Fs12000_Fc90_B1},
269      {HPF_Fs16000_Fc90_A2,                /* 16kS/s coefficients */
270       HPF_Fs16000_Fc90_A1,
271       HPF_Fs16000_Fc90_A0,
272       -HPF_Fs16000_Fc90_B2,
273       -HPF_Fs16000_Fc90_B1},
274      {HPF_Fs22050_Fc90_A2,                /* 22kS/s coefficients */
275       HPF_Fs22050_Fc90_A1,
276       HPF_Fs22050_Fc90_A0,
277       -HPF_Fs22050_Fc90_B2,
278       -HPF_Fs22050_Fc90_B1},
279      {HPF_Fs24000_Fc90_A2,                /* 24kS/s coefficients */
280       HPF_Fs24000_Fc90_A1,
281       HPF_Fs24000_Fc90_A0,
282       -HPF_Fs24000_Fc90_B2,
283       -HPF_Fs24000_Fc90_B1},
284      {HPF_Fs32000_Fc90_A2,                /* 32kS/s coefficients */
285       HPF_Fs32000_Fc90_A1,
286       HPF_Fs32000_Fc90_A0,
287       -HPF_Fs32000_Fc90_B2,
288       -HPF_Fs32000_Fc90_B1},
289      {HPF_Fs44100_Fc90_A2,                /* 44kS/s coefficients */
290       HPF_Fs44100_Fc90_A1,
291       HPF_Fs44100_Fc90_A0,
292       -HPF_Fs44100_Fc90_B2,
293       -HPF_Fs44100_Fc90_B1},
294      {HPF_Fs48000_Fc90_A2,                /* 48kS/s coefficients */
295       HPF_Fs48000_Fc90_A1,
296       HPF_Fs48000_Fc90_A0,
297       -HPF_Fs48000_Fc90_B2,
298       -HPF_Fs48000_Fc90_B1}
299  
300  #ifdef HIGHER_FS
301      ,
302      {HPF_Fs88200_Fc90_A2,                /* 88kS/s coefficients */
303       HPF_Fs88200_Fc90_A1,
304       HPF_Fs88200_Fc90_A0,
305       -HPF_Fs88200_Fc90_B2,
306       -HPF_Fs88200_Fc90_B1},
307      {HPF_Fs96000_Fc90_A2,                /* 96kS/s coefficients */
308       HPF_Fs96000_Fc90_A1,
309       HPF_Fs96000_Fc90_A0,
310       -HPF_Fs96000_Fc90_B2,
311       -HPF_Fs96000_Fc90_B1},
312      {HPF_Fs176400_Fc90_A2,                /* 176kS/s coefficients */
313       HPF_Fs176400_Fc90_A1,
314       HPF_Fs176400_Fc90_A0,
315       -HPF_Fs176400_Fc90_B2,
316       -HPF_Fs176400_Fc90_B1},
317      {HPF_Fs192000_Fc90_A2,                /* 192kS/s coefficients */
318       HPF_Fs192000_Fc90_A1,
319       HPF_Fs192000_Fc90_A0,
320       -HPF_Fs192000_Fc90_B2,
321       -HPF_Fs192000_Fc90_B1}
322  #endif
323  
324  };
325  
326  /*
327   * Band Pass Filter coefficient table
328   */
329  #ifndef BUILD_FLOAT
330  const BP_C32_Coefs_t LVDBE_BPF_Table[] = {
331  #else /*BUILD_FLOAT*/
332  const BP_FLOAT_Coefs_t LVDBE_BPF_Table[] = {
333  #endif /*BUILD_FLOAT*/
334      /* Coefficients for 55Hz centre frequency */
335      {BPF_Fs8000_Fc55_A0,                /* 8kS/s coefficients */
336       -BPF_Fs8000_Fc55_B2,
337       -BPF_Fs8000_Fc55_B1},
338      {BPF_Fs11025_Fc55_A0,                /* 11kS/s coefficients */
339       -BPF_Fs11025_Fc55_B2,
340       -BPF_Fs11025_Fc55_B1},
341      {BPF_Fs12000_Fc55_A0,                /* 12kS/s coefficients */
342       -BPF_Fs12000_Fc55_B2,
343       -BPF_Fs12000_Fc55_B1},
344      {BPF_Fs16000_Fc55_A0,                /* 16kS/s coefficients */
345       -BPF_Fs16000_Fc55_B2,
346       -BPF_Fs16000_Fc55_B1},
347      {BPF_Fs22050_Fc55_A0,                /* 22kS/s coefficients */
348       -BPF_Fs22050_Fc55_B2,
349       -BPF_Fs22050_Fc55_B1},
350      {BPF_Fs24000_Fc55_A0,                /* 24kS/s coefficients */
351       -BPF_Fs24000_Fc55_B2,
352       -BPF_Fs24000_Fc55_B1},
353      {BPF_Fs32000_Fc55_A0,                /* 32kS/s coefficients */
354       -BPF_Fs32000_Fc55_B2,
355       -BPF_Fs32000_Fc55_B1},
356      {BPF_Fs44100_Fc55_A0,                /* 44kS/s coefficients */
357       -BPF_Fs44100_Fc55_B2,
358       -BPF_Fs44100_Fc55_B1},
359      {BPF_Fs48000_Fc55_A0,                /* 48kS/s coefficients */
360       -BPF_Fs48000_Fc55_B2,
361       -BPF_Fs48000_Fc55_B1},
362  #ifdef HIGHER_FS
363       {BPF_Fs88200_Fc55_A0,                /* 88kS/s coefficients */
364        -BPF_Fs88200_Fc55_B2,
365        -BPF_Fs88200_Fc55_B1},
366       {BPF_Fs96000_Fc55_A0,                /* 96kS/s coefficients */
367       -BPF_Fs96000_Fc55_B2,
368       -BPF_Fs96000_Fc55_B1},
369       {BPF_Fs176400_Fc55_A0,                /* 176kS/s coefficients */
370        -BPF_Fs176400_Fc55_B2,
371        -BPF_Fs176400_Fc55_B1},
372       {BPF_Fs192000_Fc55_A0,                /* 192kS/s coefficients */
373       -BPF_Fs192000_Fc55_B2,
374       -BPF_Fs192000_Fc55_B1},
375  #endif
376  
377      /* Coefficients for 66Hz centre frequency */
378      {BPF_Fs8000_Fc66_A0,                /* 8kS/s coefficients */
379       -BPF_Fs8000_Fc66_B2,
380       -BPF_Fs8000_Fc66_B1},
381      {BPF_Fs11025_Fc66_A0,                /* 11kS/s coefficients */
382       -BPF_Fs11025_Fc66_B2,
383       -BPF_Fs11025_Fc66_B1},
384      {BPF_Fs12000_Fc66_A0,                /* 12kS/s coefficients */
385       -BPF_Fs12000_Fc66_B2,
386       -BPF_Fs12000_Fc66_B1},
387      {BPF_Fs16000_Fc66_A0,                /* 16kS/s coefficients */
388       -BPF_Fs16000_Fc66_B2,
389       -BPF_Fs16000_Fc66_B1},
390      {BPF_Fs22050_Fc66_A0,                /* 22kS/s coefficients */
391       -BPF_Fs22050_Fc66_B2,
392       -BPF_Fs22050_Fc66_B1},
393      {BPF_Fs24000_Fc66_A0,                /* 24kS/s coefficients */
394       -BPF_Fs24000_Fc66_B2,
395       -BPF_Fs24000_Fc66_B1},
396      {BPF_Fs32000_Fc66_A0,                /* 32kS/s coefficients */
397       -BPF_Fs32000_Fc66_B2,
398       -BPF_Fs32000_Fc66_B1},
399      {BPF_Fs44100_Fc66_A0,                /* 44kS/s coefficients */
400       -BPF_Fs44100_Fc66_B2,
401       -BPF_Fs44100_Fc66_B1},
402      {BPF_Fs48000_Fc66_A0,                /* 48kS/s coefficients */
403       -BPF_Fs48000_Fc66_B2,
404       -BPF_Fs48000_Fc66_B1},
405  #ifdef HIGHER_FS
406      {BPF_Fs88200_Fc66_A0,                /* 88kS/s coefficients */
407       -BPF_Fs88200_Fc66_B2,
408       -BPF_Fs88200_Fc66_B1},
409      {BPF_Fs96000_Fc66_A0,                /* 96kS/s coefficients */
410       -BPF_Fs96000_Fc66_B2,
411       -BPF_Fs96000_Fc66_B1},
412      {BPF_Fs176400_Fc66_A0,                /* 176kS/s coefficients */
413       -BPF_Fs176400_Fc66_B2,
414       -BPF_Fs176400_Fc66_B1},
415      {BPF_Fs192000_Fc66_A0,                /* 192kS/s coefficients */
416       -BPF_Fs192000_Fc66_B2,
417       -BPF_Fs192000_Fc66_B1},
418  #endif
419  
420      /* Coefficients for 78Hz centre frequency */
421      {BPF_Fs8000_Fc78_A0,                /* 8kS/s coefficients */
422       -BPF_Fs8000_Fc78_B2,
423       -BPF_Fs8000_Fc78_B1},
424      {BPF_Fs11025_Fc78_A0,                /* 11kS/s coefficients */
425       -BPF_Fs11025_Fc78_B2,
426       -BPF_Fs11025_Fc78_B1},
427      {BPF_Fs12000_Fc78_A0,                /* 12kS/s coefficients */
428       -BPF_Fs12000_Fc78_B2,
429       -BPF_Fs12000_Fc78_B1},
430      {BPF_Fs16000_Fc78_A0,                /* 16kS/s coefficients */
431       -BPF_Fs16000_Fc78_B2,
432       -BPF_Fs16000_Fc78_B1},
433      {BPF_Fs22050_Fc78_A0,                /* 22kS/s coefficients */
434       -BPF_Fs22050_Fc78_B2,
435       -BPF_Fs22050_Fc78_B1},
436      {BPF_Fs24000_Fc78_A0,                /* 24kS/s coefficients */
437       -BPF_Fs24000_Fc78_B2,
438       -BPF_Fs24000_Fc78_B1},
439      {BPF_Fs32000_Fc78_A0,                /* 32kS/s coefficients */
440       -BPF_Fs32000_Fc78_B2,
441       -BPF_Fs32000_Fc78_B1},
442      {BPF_Fs44100_Fc78_A0,                /* 44kS/s coefficients */
443       -BPF_Fs44100_Fc78_B2,
444       -BPF_Fs44100_Fc78_B1},
445      {BPF_Fs48000_Fc78_A0,                /* 48kS/s coefficients */
446       -BPF_Fs48000_Fc78_B2,
447       -BPF_Fs48000_Fc78_B1},
448  #ifdef HIGHER_FS
449      {BPF_Fs88200_Fc66_A0,                /* 88kS/s coefficients */
450       -BPF_Fs88200_Fc66_B2,
451       -BPF_Fs88200_Fc66_B1},
452      {BPF_Fs96000_Fc78_A0,                /* 96kS/s coefficients */
453       -BPF_Fs96000_Fc78_B2,
454       -BPF_Fs96000_Fc78_B1},
455      {BPF_Fs176400_Fc66_A0,                /* 176kS/s coefficients */
456       -BPF_Fs176400_Fc66_B2,
457       -BPF_Fs176400_Fc66_B1},
458      {BPF_Fs192000_Fc78_A0,                /* 192kS/s coefficients */
459       -BPF_Fs192000_Fc78_B2,
460       -BPF_Fs192000_Fc78_B1},
461  #endif
462  
463      /* Coefficients for 90Hz centre frequency */
464      {BPF_Fs8000_Fc90_A0,                /* 8kS/s coefficients */
465       -BPF_Fs8000_Fc90_B2,
466       -BPF_Fs8000_Fc90_B1},
467      {BPF_Fs11025_Fc90_A0,                /* 11kS/s coefficients */
468       -BPF_Fs11025_Fc90_B2,
469       -BPF_Fs11025_Fc90_B1},
470      {BPF_Fs12000_Fc90_A0,                /* 12kS/s coefficients */
471       -BPF_Fs12000_Fc90_B2,
472       -BPF_Fs12000_Fc90_B1},
473      {BPF_Fs16000_Fc90_A0,                /* 16kS/s coefficients */
474       -BPF_Fs16000_Fc90_B2,
475       -BPF_Fs16000_Fc90_B1},
476      {BPF_Fs22050_Fc90_A0,                /* 22kS/s coefficients */
477       -BPF_Fs22050_Fc90_B2,
478       -BPF_Fs22050_Fc90_B1},
479      {BPF_Fs24000_Fc90_A0,                /* 24kS/s coefficients */
480       -BPF_Fs24000_Fc90_B2,
481       -BPF_Fs24000_Fc90_B1},
482      {BPF_Fs32000_Fc90_A0,                /* 32kS/s coefficients */
483       -BPF_Fs32000_Fc90_B2,
484       -BPF_Fs32000_Fc90_B1},
485      {BPF_Fs44100_Fc90_A0,                /* 44kS/s coefficients */
486       -BPF_Fs44100_Fc90_B2,
487       -BPF_Fs44100_Fc90_B1},
488      {BPF_Fs48000_Fc90_A0,                /* 48kS/s coefficients */
489       -BPF_Fs48000_Fc90_B2,
490       -BPF_Fs48000_Fc90_B1}
491  #ifdef HIGHER_FS
492      ,
493      {BPF_Fs88200_Fc90_A0,                /* 88kS/s coefficients */
494       -BPF_Fs88200_Fc90_B2,
495       -BPF_Fs88200_Fc90_B1},
496      {BPF_Fs96000_Fc90_A0,                /* 96kS/s coefficients */
497       -BPF_Fs96000_Fc90_B2,
498       -BPF_Fs96000_Fc90_B1},
499      {BPF_Fs176400_Fc90_A0,                /* 176kS/s coefficients */
500       -BPF_Fs176400_Fc90_B2,
501       -BPF_Fs176400_Fc90_B1},
502      {BPF_Fs192000_Fc90_A0,                /* 192kS/s coefficients */
503       -BPF_Fs192000_Fc90_B2,
504       -BPF_Fs192000_Fc90_B1}
505  #endif
506  
507  
508  };
509  
510  
511  /************************************************************************************/
512  /*                                                                                  */
513  /*    AGC constant tables                                                           */
514  /*                                                                                  */
515  /************************************************************************************/
516  
517  /* Attack time (signal too large) */
518  #ifndef BUILD_FLOAT
519  const LVM_INT16 LVDBE_AGC_ATTACK_Table[] = {
520  #else /*BUILD_FLOAT*/
521  const LVM_FLOAT LVDBE_AGC_ATTACK_Table[] = {
522  #endif /*BUILD_FLOAT*/
523      AGC_ATTACK_Fs8000,
524      AGC_ATTACK_Fs11025,
525      AGC_ATTACK_Fs12000,
526      AGC_ATTACK_Fs16000,
527      AGC_ATTACK_Fs22050,
528      AGC_ATTACK_Fs24000,
529      AGC_ATTACK_Fs32000,
530      AGC_ATTACK_Fs44100,
531      AGC_ATTACK_Fs48000
532  #ifdef HIGHER_FS
533      ,AGC_ATTACK_Fs88200
534      ,AGC_ATTACK_Fs96000
535      ,AGC_ATTACK_Fs176400
536      ,AGC_ATTACK_Fs192000
537  #endif
538  
539  };
540  
541  /* Decay time (signal too small) */
542  #ifndef BUILD_FLOAT
543  const LVM_INT16 LVDBE_AGC_DECAY_Table[] = {
544  #else /*BUILD_FLOAT*/
545  const LVM_FLOAT LVDBE_AGC_DECAY_Table[] = {
546  #endif /*BUILD_FLOAT*/
547      AGC_DECAY_Fs8000,
548      AGC_DECAY_Fs11025,
549      AGC_DECAY_Fs12000,
550      AGC_DECAY_Fs16000,
551      AGC_DECAY_Fs22050,
552      AGC_DECAY_Fs24000,
553      AGC_DECAY_Fs32000,
554      AGC_DECAY_Fs44100,
555      AGC_DECAY_Fs48000
556  #ifdef HIGHER_FS
557      ,AGC_DECAY_Fs88200
558      ,AGC_DECAY_FS96000
559      ,AGC_DECAY_Fs176400
560      ,AGC_DECAY_FS192000
561  #endif
562  
563  };
564  
565  /* Gain for use without the high pass filter */
566  #ifndef BUILD_FLOAT
567  const LVM_INT32 LVDBE_AGC_GAIN_Table[] = {
568  #else /*BUILD_FLOAT*/
569  const LVM_FLOAT LVDBE_AGC_GAIN_Table[] = {
570  #endif /*BUILD_FLOAT*/
571      AGC_GAIN_0dB,
572      AGC_GAIN_1dB,
573      AGC_GAIN_2dB,
574      AGC_GAIN_3dB,
575      AGC_GAIN_4dB,
576      AGC_GAIN_5dB,
577      AGC_GAIN_6dB,
578      AGC_GAIN_7dB,
579      AGC_GAIN_8dB,
580      AGC_GAIN_9dB,
581      AGC_GAIN_10dB,
582      AGC_GAIN_11dB,
583      AGC_GAIN_12dB,
584      AGC_GAIN_13dB,
585      AGC_GAIN_14dB,
586      AGC_GAIN_15dB};
587  
588  /* Gain for use with the high pass filter */
589  #ifndef BUILD_FLOAT
590  const LVM_INT32 LVDBE_AGC_HPFGAIN_Table[] = {
591  #else /*BUILD_FLOAT*/
592  const LVM_FLOAT LVDBE_AGC_HPFGAIN_Table[] = {
593  #endif /*BUILD_FLOAT*/
594      AGC_HPFGAIN_0dB,
595      AGC_HPFGAIN_1dB,
596      AGC_HPFGAIN_2dB,
597      AGC_HPFGAIN_3dB,
598      AGC_HPFGAIN_4dB,
599      AGC_HPFGAIN_5dB,
600      AGC_HPFGAIN_6dB,
601      AGC_HPFGAIN_7dB,
602      AGC_HPFGAIN_8dB,
603      AGC_HPFGAIN_9dB,
604      AGC_HPFGAIN_10dB,
605      AGC_HPFGAIN_11dB,
606      AGC_HPFGAIN_12dB,
607      AGC_HPFGAIN_13dB,
608      AGC_HPFGAIN_14dB,
609      AGC_HPFGAIN_15dB};
610  
611  
612  /************************************************************************************/
613  /*                                                                                  */
614  /*    Volume control gain and time constant tables                                  */
615  /*                                                                                  */
616  /************************************************************************************/
617  
618  /* dB to linear conversion table */
619  #ifndef BUILD_FLOAT
620  const LVM_INT16 LVDBE_VolumeTable[] = {
621      0x4000,             /* -6dB */
622      0x47FB,             /* -5dB */
623      0x50C3,             /* -4dB */
624      0x5A9E,             /* -3dB */
625      0x65AD,             /* -2dB */
626      0x7215,             /* -1dB */
627      0x7FFF};            /*  0dB */
628  #else /*BUILD_FLOAT*/
629  const LVM_FLOAT LVDBE_VolumeTable[] = {
630      0.500000f,         /* -6dB */
631      0.562341f,         /* -5dB */
632      0.630957f,         /* -4dB */
633      0.707946f,         /* -3dB */
634      0.794328f,         /* -2dB */
635      0.891251f,         /* -1dB */
636      1.000000f};        /*  0dB */
637  #endif /*BUILD_FLOAT*/
638  
639  #ifndef BUILD_FLOAT
640  const LVM_INT16 LVDBE_VolumeTCTable[] = {
641  #else /*BUILD_FLOAT*/
642  const LVM_FLOAT LVDBE_VolumeTCTable[] = {
643  #endif /*BUILD_FLOAT*/
644      VOL_TC_Fs8000,
645      VOL_TC_Fs11025,
646      VOL_TC_Fs12000,
647      VOL_TC_Fs16000,
648      VOL_TC_Fs22050,
649      VOL_TC_Fs24000,
650      VOL_TC_Fs32000,
651      VOL_TC_Fs44100,
652      VOL_TC_Fs48000
653  #ifdef HIGHER_FS
654      ,VOL_TC_Fs88200
655      ,VOL_TC_Fs96000
656      ,VOL_TC_Fs176400
657      ,VOL_TC_Fs192000
658  #endif
659  };
660  
661  
662  
663  const LVM_INT16 LVDBE_MixerTCTable[] = {
664  
665      MIX_TC_Fs8000,
666      MIX_TC_Fs11025,
667      MIX_TC_Fs12000,
668      MIX_TC_Fs16000,
669      MIX_TC_Fs22050,
670      MIX_TC_Fs24000,
671      MIX_TC_Fs32000,
672      MIX_TC_Fs44100,
673      MIX_TC_Fs48000
674  #ifdef HIGHER_FS
675      ,MIX_TC_Fs88200
676      ,MIX_TC_Fs96000
677      ,MIX_TC_Fs176400
678      ,MIX_TC_Fs192000
679  #endif
680  
681  };
682