• 大小: 22.85MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-02
  • 语言: C/C++
  • 标签: VC++  语音识别  

资源简介

这是一个VC++下的语音识别的完整程序,做语音识别的朋友可以借鉴一下

资源截图

代码片段和文件信息

// 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 )     //构造函数

int i;
n=num;     //采样点的个数
    s=snddata;
N=300;    //每祯点数
M=100;    //过渡段长
}

CLPC::~CLPC()
{
}

float * CLPC::GetCoeffa()
{
int ijl;
float R[p+1];       //p极点个数      //Record Autocorrelation values

this->preFilter();

/////////////////////  为什么要修改N呢?
int remainder=n%100;      //modify N
framenum=n/100-2;    //祯的总数

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阶极点,计算12阶相关值
{
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()  //预加重
{
int i;
for(i=n-1;i>0;i--)
{
s[i]=s[i]-s[i-1]*0.9375;  
}


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      27820  2010-09-18 22:52  语音识别程序\Debug\BuildLog.htm

     文件      13600  2010-09-18 22:52  语音识别程序\Debug\LPC.obj

     文件          0  2010-09-18 22:52  语音识别程序\Debug\LPC.sbr

     文件         69  2010-09-18 22:52  语音识别程序\Debug\mt.dep

     文件    7793664  2010-09-18 22:52  语音识别程序\Debug\sndctl.bsc

     文件      97280  2010-09-18 22:52  语音识别程序\Debug\sndctl.exe

     文件        920  2010-09-18 22:52  语音识别程序\Debug\sndctl.exe.embed.manifest

     文件        984  2010-09-18 22:52  语音识别程序\Debug\sndctl.exe.embed.manifest.res

     文件        861  2010-09-18 22:52  语音识别程序\Debug\sndctl.exe.intermediate.manifest

     文件    1097280  2010-09-18 22:52  语音识别程序\Debug\sndctl.ilk

     文件      22375  2010-09-18 22:52  语音识别程序\Debug\sndctl.obj

     文件   28573696  2010-09-18 22:52  语音识别程序\Debug\sndctl.pch

     文件    3755008  2010-09-18 22:52  语音识别程序\Debug\sndctl.pdb

     文件       2876  2010-09-18 22:52  语音识别程序\Debug\sndctl.res

     文件          0  2010-09-18 22:52  语音识别程序\Debug\sndctl.sbr

     文件     106839  2010-09-18 22:52  语音识别程序\Debug\sndctlDlg.obj

     文件          0  2010-09-18 22:52  语音识别程序\Debug\sndctlDlg.sbr

     文件          0  2010-09-18 22:46  语音识别程序\Debug\sou.txt

     文件      23934  2010-09-18 22:52  语音识别程序\Debug\Soundin.obj

     文件          0  2010-09-18 22:52  语音识别程序\Debug\Soundin.sbr

     文件     466107  2010-09-18 22:52  语音识别程序\Debug\StdAfx.obj

     文件    3360778  2010-09-18 22:52  语音识别程序\Debug\StdAfx.sbr

     文件    1035264  2010-09-18 22:52  语音识别程序\Debug\vc90.idb

     文件    2150400  2010-09-18 22:52  语音识别程序\Debug\vc90.pdb

     文件     110644  2004-07-16 00:00  语音识别程序\DirectIO.dll

     文件       3552  2004-07-16 00:00  语音识别程序\DirectIO.lib

     文件        627  2004-07-16 00:00  语音识别程序\DirectIOLib.h

     文件        267  2004-07-16 00:00  语音识别程序\driver.h

     文件      12526  2004-07-16 00:00  语音识别程序\driver.lib

     文件       3168  2004-07-16 00:00  语音识别程序\DRIVER.SYS

............此处省略105个文件信息

评论

共有 条评论