annotate trunk/src/Modules/Features/ModuleGaussians.h @ 335:71c438f9daf7

- Scripts for running recognition experiments using AIM-C and HTK to compare MFCCs against features generated with AIM-C
author tomwalters
date Wed, 04 Aug 2010 06:41:56 +0000
parents 30dde71d0230
children 2f4530363f7a
rev   line source
tomwalters@282 1 // Copyright 2008-2010, Thomas Walters
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@318 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@318 7 // you may not use this file except in compliance with the License.
tomwalters@318 8 // You may obtain a copy of the License at
tomwalters@268 9 //
tomwalters@318 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@268 11 //
tomwalters@318 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@318 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@318 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@318 15 // See the License for the specific language governing permissions and
tomwalters@318 16 // limitations under the License.
tomwalters@268 17
tomwalters@268 18 /*! \file ModuleGaussians.h
tomwalters@268 19 * \brief Gaussian features
tomwalters@268 20 */
tomwalters@268 21
tomwalters@282 22 /*! \author Thomas Walters <tom@acousticscale.org>
tomwalters@268 23 * \date created 2008/06/23
tomwalters@296 24 * \version \$Id$
tomwalters@268 25 */
tomwalters@268 26
tomwalters@283 27 #ifndef AIMC_MODULES_FEATURES_GAUSSIANS_H_
tomwalters@283 28 #define AIMC_MODULES_FEATURES_GAUSSIANS_H_
tomwalters@268 29
tomwalters@268 30 #include <vector>
tomwalters@268 31
tomwalters@268 32 #include "Support/Module.h"
tomwalters@268 33 #include "Support/Parameters.h"
tomwalters@268 34 #include "Support/SignalBank.h"
tomwalters@268 35
tomwalters@268 36 namespace aimc {
tomwalters@268 37 using std::vector;
tomwalters@280 38 class ModuleGaussians : public Module {
tomwalters@268 39 public:
tomwalters@280 40 explicit ModuleGaussians(Parameters *pParam);
tomwalters@268 41 virtual ~ModuleGaussians();
tomwalters@268 42
tomwalters@280 43 /*! \brief Process a buffer
tomwalters@280 44 */
tomwalters@268 45 virtual void Process(const SignalBank &input);
tomwalters@268 46
tomwalters@275 47 private:
tomwalters@280 48 /*! \brief Reset the internal state of the module
tomwalters@280 49 */
tomwalters@275 50 virtual void ResetInternal();
tomwalters@268 51
tomwalters@275 52 /*! \brief Prepare the module
tomwalters@275 53 * \param input Input signal
tomwalters@275 54 * \param output true on success false on failure
tomwalters@275 55 */
tomwalters@268 56 virtual bool InitializeInternal(const SignalBank &input);
tomwalters@268 57
tomwalters@268 58 bool RubberGMMCore(int iNumComponents, bool bDoInit);
tomwalters@268 59
tomwalters@268 60 /*! \brief Number of Gaussian Components
tomwalters@268 61 */
tomwalters@268 62 int m_iParamNComp;
tomwalters@268 63
tomwalters@268 64 /*! \brief Constant variance of Gaussians
tomwalters@268 65 */
tomwalters@280 66 float m_fParamVar;
tomwalters@268 67
tomwalters@268 68 /*! \brief posterior probability expansion exponent
tomwalters@268 69 */
tomwalters@280 70 float m_fParamPosteriorExp;
tomwalters@268 71
tomwalters@268 72 /*! \brief Maximum Number of iterations
tomwalters@268 73 */
tomwalters@273 74 int m_iParamMaxIt;
tomwalters@268 75
tomwalters@268 76 /*! \brief convergence criterion
tomwalters@268 77 */
tomwalters@280 78 float m_fParamPriorsConverged;
tomwalters@268 79
tomwalters@268 80 /*! \brief The amplitudes of the components (priors)
tomwalters@268 81 */
tomwalters@280 82 vector<float> m_pA;
tomwalters@268 83
tomwalters@268 84 /*! \brief The means of the components (priors)
tomwalters@268 85 */
tomwalters@280 86 vector<float> m_pMu;
tomwalters@268 87
tomwalters@268 88 /*! \brief The spectral profile of the incoming buffer
tomwalters@268 89 */
tomwalters@280 90 vector<float> m_pSpectralProfile;
tomwalters@268 91
tomwalters@268 92 int m_iNumChannels;
tomwalters@268 93 };
tomwalters@268 94 } // namespace aimc
tomwalters@268 95
tomwalters@283 96 #endif // AIMC_MODULES_FEATURES_GAUSSIANS_H_