comparison 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
comparison
equal deleted inserted replaced
287:4b3a43b543dd 288:34993448961f
20 * \brief Slaney's gammatone filterbank 20 * \brief Slaney's gammatone filterbank
21 * 21 *
22 * \author Thomas Walters <tom@acousticscale.org> 22 * \author Thomas Walters <tom@acousticscale.org>
23 * \date created 2009/11/13 23 * \date created 2009/11/13
24 * \version \$Id$ 24 * \version \$Id$
25 *
26 * This is the version of the IIR gammatone used in Slaney's Auditory toolbox.
27 * The original verison as described in Apple Tech. Report #35 has a problem
28 * with the high-order coefficients at low centre frequencies and high sample
29 * rates. Since it is important that AIM-C can deal with these cases (for
30 * example for the Gaussian features), I've reiplemeted Slaney's alternative
31 * version which uses a cascade of four second-order filters in place of the
32 * eighth-order filter.
25 */ 33 */
26 #ifndef _AIMC_MODULES_BMM_GAMMATONE_H_ 34 #ifndef _AIMC_MODULES_BMM_GAMMATONE_H_
27 #define _AIMC_MODULES_BMM_GAMMATONE_H_ 35 #define _AIMC_MODULES_BMM_GAMMATONE_H_
28 36
29 #include <vector> 37 #include <vector>
43 virtual void Process(const SignalBank &input); 51 virtual void Process(const SignalBank &input);
44 52
45 private: 53 private:
46 virtual bool InitializeInternal(const SignalBank& input); 54 virtual bool InitializeInternal(const SignalBank& input);
47 virtual void ResetInternal(); 55 virtual void ResetInternal();
48 vector<vector<float> > forward_; 56
49 vector<vector<float> > back_; 57 // Filter coefficients
50 vector<vector<float> > state_; 58 vector<vector<double> > b1_;
51 vector<float> centre_frequencies_; 59 vector<vector<double> > b2_;
60 vector<vector<double> > b3_;
61 vector<vector<double> > b4_;
62 vector<vector<double> > a_;
63
64 vector<vector<double> > state_1_;
65 vector<vector<double> > state_2_;
66 vector<vector<double> > state_3_;
67 vector<vector<double> > state_4_;
68
69 vector<double> centre_frequencies_;
52 int num_channels_; 70 int num_channels_;
53 float max_frequency_; 71 double max_frequency_;
54 float min_frequency_; 72 double min_frequency_;
55 }; 73 };
56 } // namespace aimc 74 } // namespace aimc
57 #endif // _AIMC_MODULES_BMM_GAMMATONE_H_ 75 #endif // _AIMC_MODULES_BMM_GAMMATONE_H_