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