資源簡介
這是一個(gè)VC++下的語音識(shí)別的完整程序,做語音識(shí)別的朋友可以借鑒一下
代碼片段和文件信息
//?LPC.cpp:?implementation?of?the?CLPC?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“sndctl.h“
#include?“LPC.h“
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CLPC::CLPC(int?*?snddataint?num?)?????//構(gòu)造函數(shù)
{?
int?i;
n=num;?????//采樣點(diǎn)的個(gè)數(shù)
????s=snddata;
N=300;????//每禎點(diǎn)數(shù)
M=100;????//過渡段長
}
CLPC::~CLPC()
{
}
float?*?CLPC::GetCoeffa()
{
int?ijl;
float?R[p+1];???????//p極點(diǎn)個(gè)數(shù)??????//Record?Autocorrelation?values
this->preFilter();
/////////////////////??為什么要修改N呢?
int remainder=n%100;??????//modify?N
framenum=n/100-2;????//禎的總數(shù)
int?tmp=remainder/framenum;
a=new?float[framenum*p+1];
if(tmp>=1)
{
M=100+tmp;??//重新定義每禎的長度
N=3*M;
}
//////////////////////
HammingWnd();????????????//compute?w(m)
finaldata=new?float[N];
for(i=0;iamenum;i++)?
{
????for(j=0;j {
finaldata[j]=Hamming[j]*s[i*M+j];????
????????}
for(l=0;l<=p;l++)????//compute?R[p]//12階極點(diǎn),計(jì)算12階相關(guān)值
{
R[l]=0;
for(j=0;j<=N-1-l;j++)??
????????R[l]=R[l]+finaldata[j]*finaldata[j+l];
}
????????float?E[p+1]k[p+1]alfa[p+1][p+1]result;??????????//Durbin‘s?method?for?computing?ak
E[0]=R[0];???????
for(j=1;j<=p;j++)???
{
result=0;
for(l=1;l<=j-1;l++)
result=result+alfa[l][j-1]*R[(j-l)];
if(E[j-1]==0)
E[j-1]=0.001;
????????????k[j]=(R[j]-result)/E[j-1];
alfa[j][j]=k[j];
for(l=1;l<=j-1;l++)
alfa[l][j]=alfa[l][j-1]-k[j]*alfa[j-l][j-1];
E[j]=(1-k[j]*k[j])*E[j-1];
}
????????for(j=1;j<=p;j++)????
a[i*p+j]=alfa[j][p];
}
delete?[]finaldata;
return?a;?????//the?values?of?ak?of?each?frame?are?saved?one?by?one?.
}
void?CLPC::HammingWnd()??//定義窗
{
int?i;
for(i=0;i Hamming[i]=0.54-0.46*cos(2*3.14*i/(N-1));
}
void?CLPC::preFilter()??//預(yù)加重
{
int?i;
for(i=n-1;i>0;i--)
{
s[i]=s[i]-s[i-1]*0.9375;??
}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????27820??2010-09-18?22:52??語音識(shí)別程序\Debug\BuildLog.htm
?????文件??????13600??2010-09-18?22:52??語音識(shí)別程序\Debug\LPC.obj
?????文件??????????0??2010-09-18?22:52??語音識(shí)別程序\Debug\LPC.sbr
?????文件?????????69??2010-09-18?22:52??語音識(shí)別程序\Debug\mt.dep
?????文件????7793664??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.bsc
?????文件??????97280??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.exe
?????文件????????920??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.exe.em
?????文件????????984??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.exe.em
?????文件????????861??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.exe.intermediate.manifest
?????文件????1097280??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.ilk
?????文件??????22375??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.obj
?????文件???28573696??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.pch
?????文件????3755008??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.pdb
?????文件???????2876??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.res
?????文件??????????0??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctl.sbr
?????文件?????106839??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctlDlg.obj
?????文件??????????0??2010-09-18?22:52??語音識(shí)別程序\Debug\sndctlDlg.sbr
?????文件??????????0??2010-09-18?22:46??語音識(shí)別程序\Debug\sou.txt
?????文件??????23934??2010-09-18?22:52??語音識(shí)別程序\Debug\Soundin.obj
?????文件??????????0??2010-09-18?22:52??語音識(shí)別程序\Debug\Soundin.sbr
?????文件?????466107??2010-09-18?22:52??語音識(shí)別程序\Debug\StdAfx.obj
?????文件????3360778??2010-09-18?22:52??語音識(shí)別程序\Debug\StdAfx.sbr
?????文件????1035264??2010-09-18?22:52??語音識(shí)別程序\Debug\vc90.idb
?????文件????2150400??2010-09-18?22:52??語音識(shí)別程序\Debug\vc90.pdb
?????文件?????110644??2004-07-16?00:00??語音識(shí)別程序\DirectIO.dll
?????文件???????3552??2004-07-16?00:00??語音識(shí)別程序\DirectIO.lib
?????文件????????627??2004-07-16?00:00??語音識(shí)別程序\DirectIOLib.h
?????文件????????267??2004-07-16?00:00??語音識(shí)別程序\driver.h
?????文件??????12526??2004-07-16?00:00??語音識(shí)別程序\driver.lib
?????文件???????3168??2004-07-16?00:00??語音識(shí)別程序\DRIVER.SYS
............此處省略105個(gè)文件信息
- 上一篇:TDMS官方Dll開發(fā)包,
- 下一篇:把H264和音頻流打包成PS流
評(píng)論
共有 條評(píng)論