tomwalters@268: // Copyright 2008-2010, University of Cambridge
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@268: /*! \author Tom Walters
tomwalters@268: * \date created 2008/06/23
tomwalters@268: * \version \$Id: ModuleGaussians.h 2 2010-02-02 12:59:50Z tcw $
tomwalters@268: */
tomwalters@268:
tomwalters@268: #ifndef _AIMC_MODULE_FEATURES_GAUSSIANS_H_
tomwalters@268: #define _AIMC_MODULE_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: /*! \class ModuleGaussians "Modules/Features/ModuleGaussians.h"
tomwalters@268: * \brief
tomwalters@268: */
tomwalters@268: namespace aimc {
tomwalters@268: using std::vector;
tomwalters@268: class ModuleGaussians : public Module
tomwalters@268: {
tomwalters@268: public:
tomwalters@268: ModuleGaussians(Parameters *pParam);
tomwalters@268: virtual ~ModuleGaussians();
tomwalters@268:
tomwalters@268: //! \brief Process a buffer
tomwalters@268: virtual void Process(const SignalBank &input);
tomwalters@268:
tomwalters@268: //! \brief Reset the internal state of the module
tomwalters@268: void Reset();
tomwalters@268:
tomwalters@268: private:
tomwalters@268: /*! \brief Prepare the module
tomwalters@268: * \param input Input signal
tomwalters@268: * \param output true on success false on failure
tomwalters@268: */
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@268: float m_fParamVar;
tomwalters@268:
tomwalters@268: /*! \brief posterior probability expansion exponent
tomwalters@268: */
tomwalters@268: float m_fParamPosteriorExp;
tomwalters@268:
tomwalters@268: /*! \brief Maximum Number of iterations
tomwalters@268: */
tomwalters@268: unsigned int m_iParamMaxIt;
tomwalters@268:
tomwalters@268: /*! \brief convergence criterion
tomwalters@268: */
tomwalters@268: float m_fParamPriorsConverged;
tomwalters@268:
tomwalters@268: /*! \brief The amplitudes of the components (priors)
tomwalters@268: */
tomwalters@268: vector m_pA;
tomwalters@268:
tomwalters@268: /*! \brief The means of the components (priors)
tomwalters@268: */
tomwalters@268: vector m_pMu;
tomwalters@268:
tomwalters@268: /*! \brief The spectral profile of the incoming buffer
tomwalters@268: */
tomwalters@268: vector m_pSpectralProfile;
tomwalters@268:
tomwalters@268: int m_iNumChannels;
tomwalters@268: };
tomwalters@268: } // namespace aimc
tomwalters@268:
tomwalters@268: #endif // _AIMC_MODULE_FEATURES_GAUSSIANS_H_