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@318: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@318: // you may not use this file except in compliance with the License. tomwalters@318: // You may obtain a copy of the License at tomwalters@268: // tomwalters@318: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@268: // tomwalters@318: // Unless required by applicable law or agreed to in writing, software tomwalters@318: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@318: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@318: // See the License for the specific language governing permissions and tomwalters@318: // limitations under the License. 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@365: float priors_converged_; tomwalters@365: tomwalters@365: /*! \brief Output component positions as well as amplitudes tomwalters@365: */ tomwalters@365: bool output_positions_; tomwalters@365: tomwalters@365: /*! \brief Total number of values in the output tomwalters@365: */ tomwalters@365: int output_component_count_; 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_