tomwalters@0: // Copyright 2006-2010, Thomas Walters tomwalters@0: // tomwalters@0: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@0: // http://www.acousticscale.org/AIMC tomwalters@0: // tomwalters@0: // This program is free software: you can redistribute it and/or modify tomwalters@0: // it under the terms of the GNU General Public License as published by tomwalters@0: // the Free Software Foundation, either version 3 of the License, or tomwalters@0: // (at your option) any later version. tomwalters@0: // tomwalters@0: // This program is distributed in the hope that it will be useful, tomwalters@0: // but WITHOUT ANY WARRANTY; without even the implied warranty of tomwalters@0: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the tomwalters@0: // GNU General Public License for more details. tomwalters@0: // tomwalters@0: // You should have received a copy of the GNU General Public License tomwalters@0: // along with this program. If not, see . tomwalters@0: tomwalters@0: /*! \file tomwalters@0: * \brief tomwalters@0: */ tomwalters@0: tomwalters@0: /*! \author: Thomas Walters tomwalters@0: * \date 2010/01/23 tomwalters@0: * \version \$Id: ERBTools.h 1 2010-02-02 11:04:50Z tcw $ tomwalters@0: */ tomwalters@0: tomwalters@0: #ifndef _AIMC_SUPPORT_ERBTOOLS_H_ tomwalters@0: #define _AIMC_SUPPORT_ERBTOOLS_H_ tomwalters@0: tomwalters@0: #include tomwalters@0: tomwalters@0: namespace aimc { tomwalters@0: class ERBTools { tomwalters@0: public: tomwalters@0: static float Freq2ERB(float freq) { tomwalters@0: return 21.4f * log10(4.37f * freq / 1000.0f + 1.0f); tomwalters@0: } tomwalters@0: tomwalters@0: static float Freq2ERBw(float freq) { tomwalters@0: return 24.7f * (4.37f * freq / 1000.0f + 1.0f); tomwalters@0: } tomwalters@0: }; tomwalters@0: } tomwalters@0: tomwalters@0: #endif // _AIMC_SUPPORT_ERBTOOLS_H_