annotate trunk/src/Modules/Features/ModuleGaussians.h @ 307:a9e7737cad19

-Added CVs as well as VCs to the gen features script
author tomwalters
date Fri, 26 Feb 2010 07:12:14 +0000
parents fe5ce00a64f5
children 30dde71d0230
rev   line source
tomwalters@282 1 // Copyright 2008-2010, Thomas Walters
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@268 6 // This program is free software: you can redistribute it and/or modify
tomwalters@268 7 // it under the terms of the GNU General Public License as published by
tomwalters@268 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@268 9 // (at your option) any later version.
tomwalters@268 10 //
tomwalters@268 11 // This program is distributed in the hope that it will be useful,
tomwalters@268 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@268 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@268 14 // GNU General Public License for more details.
tomwalters@268 15 //
tomwalters@268 16 // You should have received a copy of the GNU General Public License
tomwalters@268 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@268 18
tomwalters@268 19 /*! \file ModuleGaussians.h
tomwalters@268 20 * \brief Gaussian features
tomwalters@268 21 */
tomwalters@268 22
tomwalters@282 23 /*! \author Thomas Walters <tom@acousticscale.org>
tomwalters@268 24 * \date created 2008/06/23
tomwalters@296 25 * \version \$Id$
tomwalters@268 26 */
tomwalters@268 27
tomwalters@283 28 #ifndef AIMC_MODULES_FEATURES_GAUSSIANS_H_
tomwalters@283 29 #define AIMC_MODULES_FEATURES_GAUSSIANS_H_
tomwalters@268 30
tomwalters@268 31 #include <vector>
tomwalters@268 32
tomwalters@268 33 #include "Support/Module.h"
tomwalters@268 34 #include "Support/Parameters.h"
tomwalters@268 35 #include "Support/SignalBank.h"
tomwalters@268 36
tomwalters@268 37 namespace aimc {
tomwalters@268 38 using std::vector;
tomwalters@280 39 class ModuleGaussians : public Module {
tomwalters@268 40 public:
tomwalters@280 41 explicit ModuleGaussians(Parameters *pParam);
tomwalters@268 42 virtual ~ModuleGaussians();
tomwalters@268 43
tomwalters@280 44 /*! \brief Process a buffer
tomwalters@280 45 */
tomwalters@268 46 virtual void Process(const SignalBank &input);
tomwalters@268 47
tomwalters@275 48 private:
tomwalters@280 49 /*! \brief Reset the internal state of the module
tomwalters@280 50 */
tomwalters@275 51 virtual void ResetInternal();
tomwalters@268 52
tomwalters@275 53 /*! \brief Prepare the module
tomwalters@275 54 * \param input Input signal
tomwalters@275 55 * \param output true on success false on failure
tomwalters@275 56 */
tomwalters@268 57 virtual bool InitializeInternal(const SignalBank &input);
tomwalters@268 58
tomwalters@268 59 bool RubberGMMCore(int iNumComponents, bool bDoInit);
tomwalters@268 60
tomwalters@268 61 /*! \brief Number of Gaussian Components
tomwalters@268 62 */
tomwalters@268 63 int m_iParamNComp;
tomwalters@268 64
tomwalters@268 65 /*! \brief Constant variance of Gaussians
tomwalters@268 66 */
tomwalters@280 67 float m_fParamVar;
tomwalters@268 68
tomwalters@268 69 /*! \brief posterior probability expansion exponent
tomwalters@268 70 */
tomwalters@280 71 float m_fParamPosteriorExp;
tomwalters@268 72
tomwalters@268 73 /*! \brief Maximum Number of iterations
tomwalters@268 74 */
tomwalters@273 75 int m_iParamMaxIt;
tomwalters@268 76
tomwalters@268 77 /*! \brief convergence criterion
tomwalters@268 78 */
tomwalters@280 79 float m_fParamPriorsConverged;
tomwalters@268 80
tomwalters@268 81 /*! \brief The amplitudes of the components (priors)
tomwalters@268 82 */
tomwalters@280 83 vector<float> m_pA;
tomwalters@268 84
tomwalters@268 85 /*! \brief The means of the components (priors)
tomwalters@268 86 */
tomwalters@280 87 vector<float> m_pMu;
tomwalters@268 88
tomwalters@268 89 /*! \brief The spectral profile of the incoming buffer
tomwalters@268 90 */
tomwalters@280 91 vector<float> m_pSpectralProfile;
tomwalters@268 92
tomwalters@268 93 int m_iNumChannels;
tomwalters@268 94 };
tomwalters@268 95 } // namespace aimc
tomwalters@268 96
tomwalters@283 97 #endif // AIMC_MODULES_FEATURES_GAUSSIANS_H_