annotate src/Modules/Features/ModuleGaussians.h @ 0:582cbe817f2c

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