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