⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_main.cpp

📁 gmm test... gmm test... gmm test
💻 CPP
字号:
#include "GMM.h"


/*
1.mfcc 18,880
2.mfcc 19,600
3.mfcc 13,680
4.mfcc 25,120
5.mfcc 22,000
*/




void main()
{
	/*
	int size = 18880/sizeof(float);
	int dimension = 20;
	
	float *tempfeature = new float[size];
	
	FILE *fp = fopen("testfiles\\1.mfcc", "rb");
	if(fp == NULL)
		return;
	fread(tempfeature, sizeof(float), size, fp);
	
	CGMM model;
	model.InitializeGMM(1, 20, "烙矫");
	model.Training(tempfeature, size, 10);
	for(int i = 0; i < 10; i++)
		cout << model.ViewLog(i) << endl;

	model.SaveGMM("temp.txt", true);

	model.SetName("衬窍窍");

	model.LoadGMM("烙矫", "temp.txt");

	cout << model.GetName();

	
	
	cout << "泪矫 绒侥!";
	double tempsum = 0;
	float *ttttt = tempfeature;
	for(int i = 0; i < size/dimension; i++, ttttt+=dimension)
	{
		tempsum += log(model.GetProbability(ttttt));
	}
	tempsum /= (size/dimension);

	cout << tempsum << endl;
*/

	CGMM model[10];
	int i = 0;
	CGMM::LoadGMM(model[i++], "temp.txt");
	while(CGMM::LoadGMM(model[i]) == 0)
		i++;

	model[4] = model[3];
	for(int i = 0; i < 5; i++)
	{
		cout << model[i].GetName().c_str() << endl;
		model[i].SaveGMM("temp2.txt", i);
	}
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -