Mercurial > hg > aimc
diff trunk/src/Modules/BMM/ModuleGammatone.h @ 288:34993448961f
-Updated the Slaney IIR gammatone to use a cascase of four second-order filters as per the implementtion in Slaney's auditory toolbox. This is more numerically stable at high sample rates and low centre frequencies.
author | tomwalters |
---|---|
date | Sat, 20 Feb 2010 17:56:40 +0000 |
parents | e55d0c225a57 |
children | 30dde71d0230 |
line wrap: on
line diff
--- a/trunk/src/Modules/BMM/ModuleGammatone.h Fri Feb 19 15:19:27 2010 +0000 +++ b/trunk/src/Modules/BMM/ModuleGammatone.h Sat Feb 20 17:56:40 2010 +0000 @@ -22,6 +22,14 @@ * \author Thomas Walters <tom@acousticscale.org> * \date created 2009/11/13 * \version \$Id$ + * + * This is the version of the IIR gammatone used in Slaney's Auditory toolbox. + * The original verison as described in Apple Tech. Report #35 has a problem + * with the high-order coefficients at low centre frequencies and high sample + * rates. Since it is important that AIM-C can deal with these cases (for + * example for the Gaussian features), I've reiplemeted Slaney's alternative + * version which uses a cascade of four second-order filters in place of the + * eighth-order filter. */ #ifndef _AIMC_MODULES_BMM_GAMMATONE_H_ #define _AIMC_MODULES_BMM_GAMMATONE_H_ @@ -45,13 +53,23 @@ private: virtual bool InitializeInternal(const SignalBank& input); virtual void ResetInternal(); - vector<vector<float> > forward_; - vector<vector<float> > back_; - vector<vector<float> > state_; - vector<float> centre_frequencies_; + + // Filter coefficients + vector<vector<double> > b1_; + vector<vector<double> > b2_; + vector<vector<double> > b3_; + vector<vector<double> > b4_; + vector<vector<double> > a_; + + vector<vector<double> > state_1_; + vector<vector<double> > state_2_; + vector<vector<double> > state_3_; + vector<vector<double> > state_4_; + + vector<double> centre_frequencies_; int num_channels_; - float max_frequency_; - float min_frequency_; + double max_frequency_; + double min_frequency_; }; } // namespace aimc #endif // _AIMC_MODULES_BMM_GAMMATONE_H_