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#ifndef _FILTER_H_ 19#define _FILTER_H_ 20 21#ifdef __cplusplus 22extern "C" { 23#endif /* __cplusplus */ 24 25/********************************************************************************** 26 INCLUDES 27***********************************************************************************/ 28#include "LVM_Types.h" 29#include "BIQUAD.h" 30 31 32/********************************************************************************** 33 DEFINES 34***********************************************************************************/ 35#define FILTER_LOSS 32730 /* -0.01dB loss to avoid wrapping due to band ripple */ 36#ifdef BUILD_FLOAT 37#define FILTER_LOSS_FLOAT 0.998849f 38#endif 39/********************************************************************************** 40 FUNCTION PROTOTYPES 41***********************************************************************************/ 42#ifdef BUILD_FLOAT 43 44LVM_FLOAT LVM_Power10( LVM_FLOAT X); 45 46LVM_FLOAT LVM_Polynomial(LVM_UINT16 N, 47 LVM_FLOAT *pCoefficients, 48 LVM_FLOAT X); 49#ifdef HIGHER_FS 50LVM_FLOAT LVM_GetOmega(LVM_UINT32 Fc, 51#else 52LVM_FLOAT LVM_GetOmega(LVM_UINT16 Fc, 53#endif 54 LVM_Fs_en SampleRate); 55 56LVM_FLOAT LVM_FO_LPF( LVM_FLOAT w, 57 FO_FLOAT_Coefs_t *pCoeffs); 58 59LVM_FLOAT LVM_FO_HPF( LVM_FLOAT w, 60 FO_FLOAT_Coefs_t *pCoeffs); 61#else 62LVM_INT32 LVM_Polynomial(LVM_UINT16 N, 63 LVM_INT32 *pCoefficients, 64 LVM_INT32 X); 65 66LVM_INT32 LVM_Power10( LVM_INT32 X); 67 68LVM_INT32 LVM_FO_LPF( LVM_INT32 w, 69 FO_C32_Coefs_t *pCoeffs); 70 71LVM_INT32 LVM_FO_HPF( LVM_INT32 w, 72 FO_C32_Coefs_t *pCoeffs); 73 74LVM_INT32 LVM_GetOmega(LVM_UINT16 Fc, 75 LVM_Fs_en SampleRate); 76#endif 77/**********************************************************************************/ 78#ifdef __cplusplus 79} 80#endif /* __cplusplus */ 81 82#endif /** _FILTER_H_ **/ 83 84