Marsyas
0.6.0-alpha
|
00001 /* 00002 ** Copyright (C) 1998-2006 George Tzanetakis <gtzan@cs.uvic.ca> 00003 ** 00004 ** This program is free software; you can redistribute it and/or modify 00005 ** it under the terms of the GNU General Public License as published by 00006 ** the Free Software Foundation; either version 2 of the License, or 00007 ** (at your option) any later version. 00008 ** 00009 ** This program is distributed in the hope that it will be useful, 00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ** GNU General Public License for more details. 00013 ** 00014 ** You should have received a copy of the GNU General Public License 00015 ** along with this program; if not, write to the Free Software 00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #if !defined(__QGMMMODEL_h) 00020 #define __QGMMMODEL_H 00021 00022 #include <vector> 00023 #include <marsyas/common_header.h> 00024 #include <marsyas/realvec.h> 00025 00026 namespace Marsyas 00027 { 00038 class QGMMModel 00039 { 00040 private: 00041 00042 mrs_natural maxNrGSMixes_; 00043 mrs_natural nrGSMixes_; 00044 std::vector<mrs_natural> GSmixNrFrames_; 00045 std::vector<realvec> GSmixCovMatrix_; 00046 mrs_natural totalNrFrames_; 00047 00048 mrs_real divergenceThres_; 00049 00050 realvec updateCovModel(realvec C, mrs_natural N, realvec Cm, mrs_natural Nm); 00051 mrs_real deltaBIC(realvec C1, mrs_natural N1, realvec C2, mrs_natural N2, realvec C, mrs_real lambda); 00052 00053 public: 00054 00055 QGMMModel(); 00056 QGMMModel(const QGMMModel &a); 00057 ~QGMMModel(); 00058 00059 void updateModel(realvec &covMatrix, mrs_natural nrModelFrames); 00060 void resetModel(); 00061 00062 mrs_real BICdistance(realvec &covMatrix, mrs_natural Nframes, mrs_real lambda); 00063 00064 mrs_natural nrGSMixes() {return nrGSMixes_; }; 00065 realvec& GSmixCovMatrix(mrs_natural GSmix) { return GSmixCovMatrix_[GSmix]; }; 00066 mrs_natural GSmixNrFrames(mrs_natural GSmix) { return GSmixNrFrames_[GSmix]; }; 00067 mrs_natural totalNrFrames() {return totalNrFrames_; }; 00068 00069 }; 00070 00071 }//namespace Marsyas 00072 00073 #endif 00074 00075 00076 00077 00078 00079 00080 00081