Mercurial > hg > aimc
annotate src/Modules/Output/Graphics/Scale/ScaleERB.h @ 119:9d880fb93c39
- Well, most of the graphics stuff at least compiles now. Next step is getting it running.
M Modules/Output/Graphics/GraphicsView.h
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.cc
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovieDirect.h
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc
M Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h
M Modules/Output/Graphics/Scale/ScaleLog.h
M Modules/Output/Graphics/Scale/ScaleERB.h
M Modules/Output/Graphics/Scale/ScaleLinear.h
M Modules/Output/Graphics/Scale/ScaleLogScaled.h
M Modules/Output/Graphics/Scale/Scale.cc
M Modules/Output/Graphics/Scale/Scale.h
M Support/Common.h
author | tom@acousticscale.org |
---|---|
date | Sat, 16 Oct 2010 23:05:26 +0000 |
parents | c5ac2f0c7fc5 |
children | 73c6d61440ad |
rev | line source |
---|---|
tomwalters@116 | 1 /*! |
tomwalters@116 | 2 * \file |
tomwalters@116 | 3 * \brief ERB frequency scale for generating filter banks and their frequencies |
tomwalters@116 | 4 * |
tomwalters@116 | 5 * \author Tom Walters <tcw24@cam.ac.uk> |
tomwalters@116 | 6 * \date created 2006/09/26 |
tomwalters@116 | 7 * \version \$Id: ScaleERB.h 459 2007-11-08 11:50:04Z tom $ |
tomwalters@116 | 8 */ |
tomwalters@116 | 9 /* (c) 2006, University of Cambridge, Medical Research Council |
tomwalters@116 | 10 * http://www.pdn.cam.ac.uk/groups/cnbh/aimmanual |
tomwalters@116 | 11 */ |
tomwalters@116 | 12 #ifndef __MODULE_SCALE_ERB_H__ |
tomwalters@116 | 13 #define __MODULE_SCALE_ERB_H__ |
tomwalters@116 | 14 |
tomwalters@116 | 15 #include <math.h> |
tomwalters@116 | 16 |
tom@119 | 17 #include "Modules/Output/Graphics/Scale/Scale.h" |
tom@119 | 18 |
tom@119 | 19 namespace aimc { |
tomwalters@116 | 20 |
tomwalters@116 | 21 /*! |
tomwalters@116 | 22 * \class ScaleERB "Modules/Scale/ScaleERB.h" |
tomwalters@116 | 23 * \brief ERB frequency scale for generating filter banks and their frequencies |
tomwalters@116 | 24 * |
tomwalters@116 | 25 * It is very advisable to use Scale::Create() to an instance of this scale. |
tomwalters@116 | 26 * |
tomwalters@116 | 27 * References: |
tomwalters@116 | 28 * - J. Smith and J. Abel (1999), "Bark and ERB bilinear transforms" |
tomwalters@116 | 29 * http://www-ccrma.stanford.edu/~jos/bbt/ |
tomwalters@116 | 30 */ |
tomwalters@116 | 31 class ScaleERB : public Scale { |
tomwalters@116 | 32 public: |
tomwalters@117 | 33 ScaleERB(unsigned int min, unsigned int max, float density) |
tomwalters@117 | 34 : Scale(min, max, density) { m_iType = SCALE_ERB; m_sName = "erb"; }; |
tomwalters@116 | 35 |
tomwalters@117 | 36 float FromLinear(float fFreq) { |
tomwalters@117 | 37 return 21.4f*log10(0.00437f*fFreq + 1.0f); |
tomwalters@117 | 38 }; |
tomwalters@116 | 39 |
tomwalters@117 | 40 float ToLinear(float fFreq) { |
tomwalters@117 | 41 return (pow(10, fFreq/21.4f) - 1.0f)/0.00437f; |
tomwalters@117 | 42 }; |
tomwalters@116 | 43 }; |
tom@119 | 44 } // namespace aimc |
tomwalters@116 | 45 #endif /* __MODULE_SCALE_ERB_H__ */ |