Mercurial > hg > aimc
annotate trunk/src/Modules/Output/Graphics/Scale/ScaleERB.h @ 706:f8e90b5d85fd tip
Delete CARFAC code from this repository.
It has been moved to https://github.com/google/carfac
Please email me with your github username to get access.
I've also created a new mailing list to discuss CARFAC development:
https://groups.google.com/forum/#!forum/carfac-dev
author | ronw@google.com |
---|---|
date | Thu, 18 Jul 2013 20:56:51 +0000 |
parents | dd13c9834ceb |
children |
rev | line source |
---|---|
tomwalters@397 | 1 /*! |
tomwalters@397 | 2 * \file |
tomwalters@397 | 3 * \brief ERB frequency scale for generating filter banks and their frequencies |
tomwalters@397 | 4 * |
tomwalters@397 | 5 * \author Tom Walters <tcw24@cam.ac.uk> |
tomwalters@397 | 6 * \date created 2006/09/26 |
tomwalters@397 | 7 * \version \$Id: ScaleERB.h 459 2007-11-08 11:50:04Z tom $ |
tomwalters@397 | 8 */ |
tomwalters@397 | 9 /* (c) 2006, University of Cambridge, Medical Research Council |
tomwalters@397 | 10 * http://www.pdn.cam.ac.uk/groups/cnbh/aimmanual |
tomwalters@397 | 11 */ |
tomwalters@397 | 12 #ifndef __MODULE_SCALE_ERB_H__ |
tomwalters@397 | 13 #define __MODULE_SCALE_ERB_H__ |
tomwalters@397 | 14 |
tomwalters@397 | 15 #include <math.h> |
tomwalters@397 | 16 |
tom@400 | 17 #include "Modules/Output/Graphics/Scale/Scale.h" |
tom@400 | 18 |
tom@400 | 19 namespace aimc { |
tomwalters@397 | 20 |
tomwalters@397 | 21 /*! |
tomwalters@397 | 22 * \class ScaleERB "Modules/Scale/ScaleERB.h" |
tomwalters@397 | 23 * \brief ERB frequency scale for generating filter banks and their frequencies |
tomwalters@397 | 24 * |
tomwalters@397 | 25 * It is very advisable to use Scale::Create() to an instance of this scale. |
tomwalters@397 | 26 * |
tomwalters@397 | 27 * References: |
tomwalters@397 | 28 * - J. Smith and J. Abel (1999), "Bark and ERB bilinear transforms" |
tomwalters@397 | 29 * http://www-ccrma.stanford.edu/~jos/bbt/ |
tomwalters@397 | 30 */ |
tomwalters@397 | 31 class ScaleERB : public Scale { |
tomwalters@397 | 32 public: |
tomwalters@398 | 33 ScaleERB(unsigned int min, unsigned int max, float density) |
tomwalters@398 | 34 : Scale(min, max, density) { m_iType = SCALE_ERB; m_sName = "erb"; }; |
tomwalters@397 | 35 |
tomwalters@398 | 36 float FromLinear(float fFreq) { |
tomwalters@398 | 37 return 21.4f*log10(0.00437f*fFreq + 1.0f); |
tomwalters@398 | 38 }; |
tomwalters@397 | 39 |
tomwalters@398 | 40 float ToLinear(float fFreq) { |
tomwalters@398 | 41 return (pow(10, fFreq/21.4f) - 1.0f)/0.00437f; |
tomwalters@398 | 42 }; |
tomwalters@397 | 43 }; |
tom@400 | 44 } // namespace aimc |
tomwalters@397 | 45 #endif /* __MODULE_SCALE_ERB_H__ */ |