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