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