Wave Arts VQE  1.00
Voice Quality Enhancement
EQ.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the Wave Arts VQE library.
00003  * Copyright (C) 2011 Wave Arts, Inc. (http://wavearts.com)
00004  *
00005  * VQE is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * VQE is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * A copy of the GNU General Public License is included with VQE,
00016  * and can be found online at <http://www.gnu.org/licenses/>.
00017  *
00018  * If you'd like to distribute a closed-source product which uses VQE,
00019  * you must obtain a commercial VQE license from Wave Arts.
00020  */
00026 
00027 
00028 #ifndef _EQ_H
00029 #define _EQ_H
00030 
00031 #include <stddef.h>
00032 
00033 /*
00034  * EQ state type. Double precision required even at moderate sampling rates (48kHz).
00035  */
00036 typedef double EqState;
00037 
00038 #ifndef PI
00039 #define PI      3.14159265358979323
00040 #endif
00041 
00042 /*
00043  * Direct form II first and second order coefficient structures.
00044  * Double precision is required for high sampling rates.
00045  */
00046 typedef double EqCoeffType;
00047 
00048 typedef struct {
00049         EqCoeffType b0;
00050         EqCoeffType b1;
00051         EqCoeffType a1;
00052 } Eq1Coeff;
00053 
00054 typedef struct {
00055         EqCoeffType b0;
00056         EqCoeffType b1;
00057         EqCoeffType b2;
00058         EqCoeffType a1;
00059         EqCoeffType a2;
00060 } Eq2Coeff;
00061 
00062 #ifdef  __cplusplus
00063 extern "C" {
00064 #endif
00065 
00066 /*
00067  * Mapping functions from parameters to coefficients.
00068  * fs:  sampling rate
00069  * f0:  center or cutoff frequency
00070  * H:   height in dB
00071  * W:   width in octaves
00072  * g:   filter gain
00073  */
00074 Eq1Coeff EqMap1P1ZHighPass(float fs, float f0, float g);
00075 Eq2Coeff EqMap2P2ZHighPass(float fs, float f0, float g);
00076 Eq2Coeff EqMapBandPass(float fs, float f0, float W, float g);
00077 Eq2Coeff EqMapLowShelf2(float fs, float f0, float H, float gain);
00078 Eq2Coeff EqMapHighShelf2(float fs, float f0, float H, float gain);
00079 Eq2Coeff EqMap2P2ZLowPass(float fs, float f0, float g);
00080 
00081 /*
00082  * Processing functions.
00083  */
00084 void Eq2ProcNoInterp(float *in, float *out, size_t n, Eq2Coeff *coeff, EqState *state);
00085 void Eq2MxProcNoInterp(int nchl, float **in, float **out, size_t n, Eq2Coeff *coeff, EqState **state);
00086 void Eq2MxILeafProcNoInterp(int nchl, float *in, float *out, size_t n0, Eq2Coeff *coeff, EqState **state);
00087 
00088 #ifdef  __cplusplus
00089 }
00090 #endif
00091 
00092 #endif  /* _EQ_H */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines