tomwalters@282: // Copyright 2008-2010, Thomas Walters tomwalters@268: // tomwalters@268: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@268: // http://www.acousticscale.org/AIMC tomwalters@268: // tomwalters@268: // This program is free software: you can redistribute it and/or modify tomwalters@268: // it under the terms of the GNU General Public License as published by tomwalters@268: // the Free Software Foundation, either version 3 of the License, or tomwalters@268: // (at your option) any later version. tomwalters@268: // tomwalters@268: // This program is distributed in the hope that it will be useful, tomwalters@268: // but WITHOUT ANY WARRANTY; without even the implied warranty of tomwalters@268: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the tomwalters@268: // GNU General Public License for more details. tomwalters@268: // tomwalters@268: // You should have received a copy of the GNU General Public License tomwalters@268: // along with this program. If not, see . tomwalters@268: tomwalters@268: /*! \file ModuleGaussians.h tomwalters@268: * \brief Gaussian features tomwalters@268: */ tomwalters@268: tomwalters@282: /*! \author Thomas Walters tomwalters@268: * \date created 2008/06/23 tomwalters@296: * \version \$Id$ tomwalters@268: */ tomwalters@268: tomwalters@283: #ifndef AIMC_MODULES_FEATURES_GAUSSIANS_H_ tomwalters@283: #define AIMC_MODULES_FEATURES_GAUSSIANS_H_ tomwalters@268: tomwalters@268: #include tomwalters@268: tomwalters@268: #include "Support/Module.h" tomwalters@268: #include "Support/Parameters.h" tomwalters@268: #include "Support/SignalBank.h" tomwalters@268: tomwalters@268: namespace aimc { tomwalters@268: using std::vector; tomwalters@280: class ModuleGaussians : public Module { tomwalters@268: public: tomwalters@280: explicit ModuleGaussians(Parameters *pParam); tomwalters@268: virtual ~ModuleGaussians(); tomwalters@268: tomwalters@280: /*! \brief Process a buffer tomwalters@280: */ tomwalters@268: virtual void Process(const SignalBank &input); tomwalters@268: tomwalters@275: private: tomwalters@280: /*! \brief Reset the internal state of the module tomwalters@280: */ tomwalters@275: virtual void ResetInternal(); tomwalters@268: tomwalters@275: /*! \brief Prepare the module tomwalters@275: * \param input Input signal tomwalters@275: * \param output true on success false on failure tomwalters@275: */ tomwalters@268: virtual bool InitializeInternal(const SignalBank &input); tomwalters@268: tomwalters@268: bool RubberGMMCore(int iNumComponents, bool bDoInit); tomwalters@268: tomwalters@268: /*! \brief Number of Gaussian Components tomwalters@268: */ tomwalters@268: int m_iParamNComp; tomwalters@268: tomwalters@268: /*! \brief Constant variance of Gaussians tomwalters@268: */ tomwalters@280: float m_fParamVar; tomwalters@268: tomwalters@268: /*! \brief posterior probability expansion exponent tomwalters@268: */ tomwalters@280: float m_fParamPosteriorExp; tomwalters@268: tomwalters@268: /*! \brief Maximum Number of iterations tomwalters@268: */ tomwalters@273: int m_iParamMaxIt; tomwalters@268: tomwalters@268: /*! \brief convergence criterion tomwalters@268: */ tomwalters@280: float m_fParamPriorsConverged; tomwalters@268: tomwalters@268: /*! \brief The amplitudes of the components (priors) tomwalters@268: */ tomwalters@280: vector m_pA; tomwalters@268: tomwalters@268: /*! \brief The means of the components (priors) tomwalters@268: */ tomwalters@280: vector m_pMu; tomwalters@268: tomwalters@268: /*! \brief The spectral profile of the incoming buffer tomwalters@268: */ tomwalters@280: vector m_pSpectralProfile; tomwalters@268: tomwalters@268: int m_iNumChannels; tomwalters@268: }; tomwalters@268: } // namespace aimc tomwalters@268: tomwalters@283: #endif // AIMC_MODULES_FEATURES_GAUSSIANS_H_