annotate trunk/src/Support/ERBTools.h @ 268:e14c70d1b171

- Initial add of support code and modules. Not everything is working yet.
author tomwalters
date Fri, 12 Feb 2010 12:31:23 +0000
parents
children 6b4921704eb1
rev   line source
tomwalters@268 1 // Copyright 2006-2010, Thomas Walters
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@268 6 // This program is free software: you can redistribute it and/or modify
tomwalters@268 7 // it under the terms of the GNU General Public License as published by
tomwalters@268 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@268 9 // (at your option) any later version.
tomwalters@268 10 //
tomwalters@268 11 // This program is distributed in the hope that it will be useful,
tomwalters@268 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@268 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@268 14 // GNU General Public License for more details.
tomwalters@268 15 //
tomwalters@268 16 // You should have received a copy of the GNU General Public License
tomwalters@268 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@268 18
tomwalters@268 19 /*! \file
tomwalters@268 20 * \brief
tomwalters@268 21 */
tomwalters@268 22
tomwalters@268 23 /*! \author: Thomas Walters <tom@acousticscale.org>
tomwalters@268 24 * \date 2010/01/23
tomwalters@268 25 * \version \$Id: ERBTools.h 1 2010-02-02 11:04:50Z tcw $
tomwalters@268 26 */
tomwalters@268 27
tomwalters@268 28 #ifndef _AIMC_SUPPORT_ERBTOOLS_H_
tomwalters@268 29 #define _AIMC_SUPPORT_ERBTOOLS_H_
tomwalters@268 30
tomwalters@268 31 #include <math.h>
tomwalters@268 32
tomwalters@268 33 namespace aimc {
tomwalters@268 34 class ERBTools {
tomwalters@268 35 public:
tomwalters@268 36 static float Freq2ERB(float freq) {
tomwalters@268 37 return 21.4f * log10(4.37f * freq / 1000.0f + 1.0f);
tomwalters@268 38 }
tomwalters@268 39
tomwalters@268 40 static float Freq2ERBw(float freq) {
tomwalters@268 41 return 24.7f * (4.37f * freq / 1000.0f + 1.0f);
tomwalters@268 42 }
tomwalters@268 43 };
tomwalters@268 44 }
tomwalters@268 45
tomwalters@268 46 #endif // _AIMC_SUPPORT_ERBTOOLS_H_