annotate src/Modules/BMM/ModuleGammatone.h @ 25:e361baf69120

-Added a bit of junk to try and build a bianry for OS X 10.4 in SConstruct -Fixes to the FileList to build on linux - hopefully
author tomwalters
date Tue, 23 Feb 2010 21:51:11 +0000
parents 2a5354042241
children c5f5e9569863
rev   line source
tomwalters@4 1 // Copyright 2009-2010, Thomas Walters
tomwalters@4 2 //
tomwalters@4 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@4 4 // http://www.acousticscale.org/AIMC
tomwalters@4 5 //
tomwalters@4 6 // This program is free software: you can redistribute it and/or modify
tomwalters@4 7 // it under the terms of the GNU General Public License as published by
tomwalters@4 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@4 9 // (at your option) any later version.
tomwalters@4 10 //
tomwalters@4 11 // This program is distributed in the hope that it will be useful,
tomwalters@4 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@4 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@4 14 // GNU General Public License for more details.
tomwalters@4 15 //
tomwalters@4 16 // You should have received a copy of the GNU General Public License
tomwalters@4 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@4 18
tomwalters@4 19 /*! \file
tomwalters@4 20 * \brief Slaney's gammatone filterbank
tomwalters@4 21 *
tomwalters@4 22 * \author Thomas Walters <tom@acousticscale.org>
tomwalters@4 23 * \date created 2009/11/13
tomwalters@4 24 * \version \$Id$
tomwalters@16 25 *
tomwalters@16 26 * This is the version of the IIR gammatone used in Slaney's Auditory toolbox.
tomwalters@16 27 * The original verison as described in Apple Tech. Report #35 has a problem
tomwalters@16 28 * with the high-order coefficients at low centre frequencies and high sample
tomwalters@16 29 * rates. Since it is important that AIM-C can deal with these cases (for
tomwalters@16 30 * example for the Gaussian features), I've reiplemeted Slaney's alternative
tomwalters@16 31 * version which uses a cascade of four second-order filters in place of the
tomwalters@16 32 * eighth-order filter.
tomwalters@4 33 */
tomwalters@8 34 #ifndef _AIMC_MODULES_BMM_GAMMATONE_H_
tomwalters@8 35 #define _AIMC_MODULES_BMM_GAMMATONE_H_
tomwalters@4 36
tomwalters@4 37 #include <vector>
tomwalters@4 38
tomwalters@5 39 #include "Support/Module.h"
tomwalters@5 40 #include "Support/Parameters.h"
tomwalters@5 41 #include "Support/SignalBank.h"
tomwalters@5 42
tomwalters@4 43 namespace aimc {
tomwalters@4 44 using std::vector;
tomwalters@4 45 class ModuleGammatone : public Module {
tomwalters@4 46 public:
tomwalters@8 47 explicit ModuleGammatone(Parameters *params);
tomwalters@4 48 virtual ~ModuleGammatone();
tomwalters@8 49 /*! \brief Process a buffer
tomwalters@8 50 */
tomwalters@4 51 virtual void Process(const SignalBank &input);
tomwalters@4 52
tomwalters@4 53 private:
tomwalters@4 54 virtual bool InitializeInternal(const SignalBank& input);
tomwalters@4 55 virtual void ResetInternal();
tomwalters@16 56
tomwalters@16 57 // Filter coefficients
tomwalters@16 58 vector<vector<double> > b1_;
tomwalters@16 59 vector<vector<double> > b2_;
tomwalters@16 60 vector<vector<double> > b3_;
tomwalters@16 61 vector<vector<double> > b4_;
tomwalters@16 62 vector<vector<double> > a_;
tomwalters@16 63
tomwalters@16 64 vector<vector<double> > state_1_;
tomwalters@16 65 vector<vector<double> > state_2_;
tomwalters@16 66 vector<vector<double> > state_3_;
tomwalters@16 67 vector<vector<double> > state_4_;
tomwalters@16 68
tomwalters@16 69 vector<double> centre_frequencies_;
tomwalters@4 70 int num_channels_;
tomwalters@16 71 double max_frequency_;
tomwalters@16 72 double min_frequency_;
tomwalters@4 73 };
tomwalters@8 74 } // namespace aimc
tomwalters@8 75 #endif // _AIMC_MODULES_BMM_GAMMATONE_H_