基于DTW模型的语音识别
- 格式:doc
- 大小:307.00 KB
- 文档页数:24
广州大学机械与电气工程学院数字语音信号处理基于DTW算法的语音识别原理与实现院系: 机电学院电子与通信工程姓名: 张翔学号: 2111307030 指导老师: 王杰完成日期: 2014-06-11基于DTW算法的语音识别原理与实现[摘要]以一个能识别数字0~9的语音识别系统的实现过程为例,阐述了基于DTW算法的特定人孤立词语音识别的基本原理和关键技术。
其中包括对语音端点检测方法、特征参数计算方法和DTW算法实现的详细讨论,最后给出了在Matlab下的编程方法和实验结果,结果显示该算法可以很好的显示特定人所报出的电话号码。
[关键字]语音识别;端点检测;MFCC系数;DTW算法Principle and Realization of Speech Recognition Based on DTW AlgorithmAbstract With an example of the realization of a 0~9 identifiable speech recognition system, the paper described the basic principles and key technologies of isolated word speech recognition based on DTW algorithm, including method of endpoint detection, calculation of characteristic parameters, and implementation of DTW algorithm. Programming method under Matlab and experimental results are given at the end of the paper.,and the results show that the algorithm can well display the phone number of the person reported.Keyword speech recognition; endpoint detection; MFCC parameter; DTW algorithm一、引言自计算机诞生以来,通过语音与计算机交互一直是人类的梦想,随着计算机软硬件和信息技术的飞速发展,人们对语音识别功能的需求也更加明显和迫切。
摘要现今,运用语音技术越来越来方便人类的生活。
语音技术经常被用于听写、交互和识别。
同时语音技术属于生物识别认证中的一种。
说话人识别是语音技术中一种较为常见的应用形式。
使用识别系统比对识别提取的特征参数,进而能够准确地识别说话者。
本文以非特定人文本内容无关的说话人识别为研究对象,针对常见的系统做出改进,在不增加识别的时间的前提下,有效提高了识别的准确率。
本文所做工作主要包括:(1)针对说话人识别特征参数进行了优化。
常用的特征参数为LPCC和MFCC参数。
MFCC依据人耳听觉特性,包含了语音频率结构的时间变化信息,具有更好的鲁棒性,所以更多的被使用。
然而MFCC易被模仿,因此,我们添加了一个常见的语音特征参数——基音周期到说话者识别系统中。
基音周期包含有关语音频率结构的信息,不容易模仿。
故将MFCC 和基音周期二者结合,在不影响识别时间的前提下,实现了说话人的识别率的提升。
(2)针对说话人识别模型进行了优化。
常见的语音识别体系中通常采用高斯混合模型,然而单一的高斯混合模型识别的数据量通常很大,导致识别时间过长。
本文针对识别时间和识别率联合做出优化。
提出一种新的思路,先用DTW计算语音样本间基音周期的最短距离,同时用GMM的识别方法计算需要测试的语音的梅尔倒谱系数。
这样运用两个模型的识别结果共同进行判断,使得识别结果更准确;算法同时对DTW采取放宽端点限制的优化方法。
实验表明,这种DTW和GMM相结合的说话人识别模型在提高识别准确率和减少识别时间方面有了明显的改进。
关键词:说话人识别,基音周期,梅尔频率倒谱系数,动态时间规整,高斯混合模型AbstractToday, the speech processing technology is being used to increasing convenience for human life. It can be used for dictation, interaction and recognition. At the same time, speech processing technology is one of the biometric authentication. Speaker recognition is a more common form of application in speech technology. The recognition system is used to accurately recognize the speaker by identifying the extracted feature parameters.In this thesis, we focus on speaker recognition which is irrelevant to the content of non-specific texts. The speaker recognition of non-specific human text content is taken as the research object, and the improvement of common system is made.The accuracy of recognition is effectively improved without affecting the time of recognition. The work done in this thesis mainly includes:(1) Optimization for speaker recognition feature parameters. LPCC and MFCC are commonly used characteristic parameters. The MFCC contains time-varying information of the speech frequency structure according to the human auditory characteristics, and has better robustness. However, the MFCC is easily mimicked, so a common speech feature parameter, the pitch period, is added to the speaker recognition system. The pitch period contains information about the structure of the speech frequency and is not easy to be imitated. Therefore, combining the MFCC and the pitch period, the recognition rate of the speaker is improved without affecting the recognition time.(2) Optimization for the speaker recognition model. Gaussian mixture models are commonly used in common speech recognition systems. However, the amount of data recognized by a single Gaussian mixture model is usually large, resulting in an excessive recognition time. This thesis optimizes the combination of recognition time and recognition rate. A new idea is proposed. Firstly, the shortest distance of the pitch period between speech samples is calculated by DTW, and the Mel cepstrum coefficients of the speech to be tested are calculated by the GMM recognition method. In this way, the recognition results of the two models are combined to make the judgment, so that the recognition result is more accurate. In the meantime, DTW is optimized by relaxing endpoint restrictions. Experiments show that the speaker recognition model combined with DTW and GMM has significantly improved recognition accuracy and reduced recognition time.Key words: speaker recognition, pitch period, MFCC, DTW, GMM目录专用术语注释表 (V)第一章绪论 (1)1.1 课题的背景及意义 (1)1.2 语音识别的研究现状 (2)1.3 语音识别的应用 (4)1.4 说话人识别的研究重点 (5)1.5 主要内容及结构安排 (6)第二章语音识别的基础知识 (7)2.1 语音信号预处理 (8)2.1.1 采样与量化 (8)2.1.2 预加重、分帧和加窗 (9)2.2 端点检测 (11)2.2.1 语音信号短时能量 (11)2.2.2 语音信号短时平均过零率 (12)2.2.3 基于双时域参数的双门限端点检测 (12)2.3 语音特征参数提取 (13)2.3.1 线性预测倒谱参数(LPCC) (14)2.3.2 Mel频率倒谱系数(MFCC) (15)2.4 本章小结 (17)第三章基于混合特征参数的说话人识别优化算法 (18)3.1 基音周期的引入 (19)3.1.1 基音周期的含义 (19)3.1.2 基音周期的检测方法 (19)3.1.3 基音周期的提取步骤 (20)3.1.4 说话人识别实验结果及分析 (21)3.2 MFCC参数的优化 (22)3.2.1 MFCC参数的提取 (22)3.2.2 半升正弦函数MFCC参数优化原理 (23)3.2.3 实验结果及分析 (24)3.3 本章小结 (25)第四章说话人识别模型优化算法 (26)4.1 DTW算法模型 (27)4.2 HMM算法模型 (31)4.2.1 马尔科夫链 (31)4.2.2 HMM模型 (32)4.3 高斯混合模型 (33)4.3.1 EM算法 (35)4.3.2 基于高斯混合模型的说话人识别 (39)4.4 DTW算法优化 (40)4.4.1 搜索宽度限制 (40)4.4.2 放宽端点限制 (41)4.4.3 DTW算法优化实验结果及分析 (41)4.5 基于DTW+GMM说话人识别实验结果及分析 (42)4.6 本章小结 (43)第五章总结和展望 (45)5.1 总结 (45)5.2 工作展望 (45)参考文献 (47)附录1 攻读硕士学位期间申请的专利 (51)致谢 (52)专用术语注释表缩略词说明:第一章绪论1.1课题的背景及意义对于人类和许多高等等动物来说,语言的交流与沟通是传递信息和交流感情的最有效、最直接的方式。
基于非线性取值DTW算法的鲁棒性语音识别系统张宇昕;丁岩【期刊名称】《长春理工大学学报(自然科学版)》【年(卷),期】2013(000)006【摘要】In this paper, an efficient robust speech recognition system in noisy environment was proposed. A smooth function is used to short time energy (STE), which has improved the detection accuracy of STE. The complexity of running spectrum filtering is high, because two band-pass filter are used. Hence, the cepstrum mean subtraction (CMS) was used to reduce the convolution noise in logarithm spectrum, and the calculation is reduced more much. Unlike conventional DTW (Dynamic Time Warping) algorithms, which search for the reference word with minimum distance from the unknown speech waveform, a nonlinear median filter (NMF) was used and the reference word with minimum median distance from the unknown speech waveform was searched for.DTW implementations can be improved substantially. In this approach yields,DTW recognition accuracyis higher than that of the HMM techniques. However, the training is saved.%提出了一个在噪声环境下高效的语音识别系统。
DTW语音识别算法(部分)附录2:训练函数:train.mdisp('正在生成训练参数……');for i=1:20fname=sprintf('train\\%d0.wav',i);[k,fs]=audioread(fname); [StartPoint,EndPoint]=vad_m(k,fs);cc=mfcc(k);cc=cc(StartPoint-2:EndPoint-2,:);ref(i+1).StartPoint=StartPoint;ref(i+1).EndPoint=EndPoint;ref(i+1).mfcc=cc;enddisp('正在存储模板库……');save 'mfcc.mat' ref;disp('存储完毕')附录3:测试函数:dtwtest.mclear;close all;clc;disp('正在导入参考模板参数...');load mfcc.mat;disp('正在计算测试模板的参数...')for i=0:3fname = sprintf('test\\%d1.wav',i);[k,fs]=audioread(fname); [StartPoint,EndPoint]=vad_m(k,fs);cc=mfcc(k);cc=cc(StartPoint-2:EndPoint-2,:);test(i+1).StartPoint=StartPoint;test(i+1).EndPoint=EndPoint;test(i+1).mfcc=cc;enddisp('正在进行模板匹配...')dist = zeros(1,20);for i=1:4for j=1:20dist(i,j) = dtw(test(i).mfcc, ref(j).mfcc);endenddisp('正在计算匹配结果...')for i=1:4[d,j] = min(dist(i,:));if (j>=1 && j<=5)fprintf('测试模板%d1.wav 的识别结果为:前进\n',i-1); endif (j>= 6 && j<=10)fprintf('测试模板%d1.wav 的识别结果为:停止\n',i-1); endif (j>=11 && j<=15)fprintf('测试模板%d1.wav 的识别结果为:左转\n',i-1); endif (j>=16 && j<=20)fprintf('测试模板%d1.wav 的识别结果为:右转\n',i-1); endendclose all;附录4:特征提取函数:vad_m.mfunction [StartPoint,EndPoint]=vad(k,fs)%% [StartPoint,EndPoint]=vad(k,fs)%% 语音信号端点检测程序,k为语音信号,%% fs为其采样频率,程序绘制出语音信号%% 相关波形图并返回起止端点所对帧号close all% 幅度归一化到[-1,1]k=double(k);k=k./max(abs(k));%------------------------------% 显示波形%------------------------------SNR=5; % 设置SNRsignal=Gnoisegen(k,SNR); % 叠加噪声snr1=SNR_singlech(k,signal); % 计算叠加噪声后的信噪比N=length(k); % 信号长度t=(0:N-1)/fs; % 设置时间IS=.25; % 设置IS% 调用WienerScalart96m_2函数做维纳滤波output=WienerScalart96m_2(signal,fs,IS,0.12);ol=length(output); % 把output补到与x等长if ol<n< p=""> output=[output; zeros(N-ol,1)];endsnr2=SNR_singlech(k,output); % 计算维纳滤波后的信噪比snr=snr2-snr1;fprintf('snr1=%5.4f snr2=%5.4f snr=%5.4f\n',snr1,snr2,snr); subplot 311; plot(t,k,'k'); grid; axis tight;title('纯语音波形'); ylabel('幅值')subplot 312; plot(t,signal,'k'); grid; axis tight;title(['带噪语音信噪比=' num2str(SNR) 'dB']); ylabel('幅值')subplot 313; plot(t,output,'k');grid; ylim([-1 1]);title('维纳滤波后波形'); ylabel('幅值'); xlabel('时间/s');disp('显示原始波形图……');t=0:1/fs:(length(k)-1)/fs;% subplot(3,1,1);plot(t,k);axis([0,(length(k)-1)/fs,min(k),max(k)]); title('语音信号波形');xlabel('Time:s');ylabel('Amplitude(normalized)');disp('显示语音起始处放大波形图……');t1=0.2:1/fs:0.3;k1=k(0.2*fs:0.3*fs);subplot(3,1,2);plot(t1,k1);axis([0.2,0.3,min(k),max(k)]);title('(II) “00.wav”语音起始处放大波形图'); xlabel('Time:s');ylabel('Amplitude(normalized)');disp('显示语音结束处放大波形图……');t1=0.4:1/fs:0.5;k1=k(0.4*fs:0.5*fs);subplot(3,1,3);plot(t1,k1);axis([0.4,0.5,min(k),max(k)]);title('(III) “00.wav”语音结束处放大波形图'); xlabel('Time:s');ylabel('Amplitude(normalized)');%------------------------------% 计算短时过零率%------------------------------k=output;FrameLen=240;FrameInc=80;FrameTemp1=enframe(k(1:end-1),FrameLen,FrameInc);FrameTemp2=enframe(k(2:end),FrameLen,FrameInc);signs=(FrameT emp1.*FrameTemp2)<0;diffs=abs(FrameTemp1-FrameTemp2)>0.01;zcr=sum(signs.*diffs,2);zcrm=multimidfilter(zcr,5);disp('显示原始波形图……');figure,subplot(3,1,1);plot(t,k);axis([0,(length(k)-1)/fs,min(k),max(k)]);title('(I) 语音信号波形');xlabel('Time:s');ylabel('Amplitude(normalized)');disp('显示短时过零率……')zcrInd=1:length(zcrm);subplot(3,1,2);plot(zcrInd,zcr);axis([0,length(zcr),0,max(zcr)]);title('(II) 短时过零率');xlabel('Frame');ylabel('Zcr');%------------------------------% 计算短时能量%------------------------------amp=sum(abs(enframe(filter([1 -0.9375], 1, k), FrameLen, FrameInc)), 2); ampm=multimidfilter(amp,5);disp('显示短时能量……')ampInd=1:length(ampm);subplot(3,1,3);plot(ampInd,amp);axis([0,length(amp),0,max(amp)]);title('(III) 短时能量');xlabel('Frame');ylabel('Energy');% ------------------------------% 设置门限%------------------------------disp('设置门限……');ZcrLow=max([round(mean(zcr)*0.1),3]); %过零率低门限ZcrHigh=max([round(max(zcr)*0.1),5]); %过零率高门限AmpLow=min([min(amp)*10,mean(amp)*0.2,max(amp)*0.1] ); %能量低门限AmpHigh=max([min(amp)*10,mean(amp)*0.2,max(amp)*0.1 ]); %能量高门限%------------------------------% 端点检测%------------------------------MaxSilence=30; %最长语音间隙时间MinAudio=15; %最短语音时间Status=0; %状态:0静音段,1过渡段,2语音段,3结束段HoldTime=0; %语音持续时间SilenceTime=0; %语音间隙时间disp('开始端点检测……');for n=1:length(zcr)switch Statuscase{0,1}if amp(n)>AmpHigh | zcr(n)>ZcrHighStartPoint=n-HoldTime;Status=2;HoldTime=HoldTime+1;SilenceTime=0;elseif amp(n)>AmpLow | zcr(n)>ZcrLowStatus=1;HoldTime=HoldTime+1;elseStatus=0;HoldTime=0;endcase 2,if amp(n)>AmpLow | zcr(n)>ZcrLowHoldTime=HoldTime+1;elseSilenceTime=SilenceTime+1;if SilenceTime<maxsilence< p="">HoldTime=HoldTime+1;elseif (HoldTime-SilenceTime)<minaudio< p=""> Status=0;HoldTime=0;SilenceTime=0;elseStatus=3;endendcase 3,break;endif Status==3break;endendHoldTime =HoldTime-SilenceTime;EndPoint=StartPoint+HoldTime;disp('显示端点……');figure,subplot(3,1,1);plot(k);axis([1,length(k),min(k),max(k)]);title('(I) 语音信号');xlabel('Sample');ylabel('Speech');line([StartPoint*FrameInc,StartPoint*FrameInc],[min(k),max( k)],'color','red');line([EndPoint*FrameInc,EndPoint*FrameInc],[min(k),max(k)],'col or','red'); subplot(3,1,2);plot(zcr);axis([1,length(zcr),0,max(zcr)]);title('(II) 短时过零率');xlabel('Frame');ylabel('ZCR');line([StartPoint,StartPoint],[0,max(zcr)],'Color','red');line([EndPoint,EndPoint],[0,max(zcr)],'Color','red'); subplot(3,1,3);plot(amp);axis([1,length(amp),0,max(amp)]);title('(III) 短时能量');xlabel('Frame');ylabel('Energy');line([StartPoint,StartPoint],[0,max(amp)],'Color','red');line([EndPoint,EndPoint],[0,max(amp)],'Color','red');附录5:DTW算法function dist = dtw(test, ref)global x y_min y_maxglobal t rglobal D dglobal m nt = test;r = ref;n = size(t,1);m = size(r,1);d = zeros(m,1);D = ones(m,1) * realmax;D(1) = 0;% 如果两个模板长度相差过多,匹配失败if (2*m-n<3) | (2*n-m<2)dist = realmax;returnend% 计算匹配区域xa = round((2*m-n)/3);xb = round((2*n-m)*2/3);if xb>xa%xb>xa, 按下面三个区域匹配% 1 :xa% xa+1:xb% xb+1:Nfor x = 1:xay_max = 2*x;y_min = round(0.5*x);warpendfor x = (xa+1):xby_max = round(0.5*(x-n)+m); y_min = round(0.5*x);warpendfor x = (xb+1):ny_max = round(0.5*(x-n)+m); y_min = round(2*(x-n)+m); warpendelseif xa>xb%xa>xb, 按下面三个区域匹配% 0 :xb% xb+1:xa% xa+1:Nfor x = 1:xby_max = 2*x;y_min = round(0.5*x);warpendfor x = (xb+1):xay_max = 2*x;y_min = round(2*(x-n)+m); warpendfor x = (xa+1):ny_max = round(0.5*(x-n)+m); y_min = round(2*(x-n)+m); warpendelseif xa==xb%xa=xb, 按下面两个区域匹配% 0 :xa% xa+1:Nfor x = 1:xay_max = 2*x;y_min = round(0.5*x);warpendfor x = (xa+1):ny_max = round(0.5*(x-n)+m); y_min = round(2*(x-n)+m); warpendend%返回匹配分数dist = D(m);function warpglobal x y_min y_max global t rglobal D dglobal m nd = D;for y = y_min:y_maxD1 = D(y);if y>1D2 = D(y-1);elseD2 = realmax;endif y>2D3 = D(y-2);elseD3 = realmax;endd(y) = sum((t(x,:)-r(y,:)).^2) + min([D1,D2,D3]); end D = d;</minaudio<></maxsilence<></n<>。
基于DTW和HMM的语音识别算法仿真及软件设计的开题报告一、研究背景与意义随着信息技术的不断发展,语音识别技术逐步成熟,逐渐应用到语音唤醒、人机交互、语音翻译、语音控制等各种领域。
目前,基于概率模型的语音识别技术已经占据主流,其中,基于DTW和HMM的语音识别算法是最为广泛应用的方法之一。
DTW是一种基于动态规划的模式匹配算法,其主要用于处理两个时间序列模式之间的相似性匹配问题。
而HMM则是一种统计模型,主要用于处理隐含在观测序列中的状态序列,其在语音识别中也有广泛的应用。
本研究旨在基于DTW和HMM算法,开发一种语音识别仿真系统,通过实现该系统,熟悉DTW和HMM算法的原理及应用,提高各种语音信号处理技术的算法实现水平,并为相关领域的研究提供支持。
二、研究内容与方案1.研究内容(1)DTW算法的原理及应用(2)HMM算法的原理及应用(3)基于DTW和HMM的语音识别算法(4)搭建语音识别仿真系统(5)语音信号传输与处理实现2.方案(1)理论研究通过查阅文献,了解DTW算法和HMM算法的原理及其在语音识别中的应用,熟悉相关基本概念和算法流程。
(2)算法设计基于理论研究的基础,设计基于DTW和HMM的语音识别算法,包括算法流程、数学模型及程序实现等。
(3)软件开发使用MATLAB等工具,搭建语音识别仿真系统,实现语音信号的生成、传输和处理等功能。
(4)实验验证通过模拟实验和实际语音识别测试,验证基于DTW和HMM的语音识别算法在不同情景下的稳定性和准确性,并对系统进行优化和改进。
三、预期成果(1)基于DTW和HMM算法的语音识别程序和仿真系统。
(2)语音识别测试数据和结果统计分析报告。
(3)相关算法的理论和应用研究论文。
四、研究进展目前,已经完成了阶段性的理论研究和算法设计工作,并搭建了部分语音识别仿真系统。
下一步,将继续完善语音信号传输和处理部分,进行实验验证和优化。
预计两个月内完成本研究任务。
基于DTW 算法的语音识别系统实现吴晓平,崔光照,路 康(郑州轻工业学院信息与控制工程系,河南省郑州市450002)【摘 要】 动态时间归整(DTW )算法的实现简单有效,在孤立词语音识别系统中得到了广泛的应用。
介绍了将DTW 算法移植到TMS320VC5402上实现孤立词语音识别的原理、系统硬件组成和软件设计。
研究结果表明,系统能满足实时性能要求,识别效果良好。
关键词:动态时间归整(DTW )算法,语音识别,线性预测,端点检测中图分类号:TN912.34收稿日期:2004-03-240 引 言动态时间归整(DTW )算法是把时间归整和间距测量计算结合起来的一种非线性归整技术,与隐式马尔可夫模型(H MM )算法相比,它不是一种有效的利用统计方法进行训练的算法,同时,也不容易将底层和顶层的各种知识用到识别算法中,在解决大词汇量、连续语音、非特定发音人语音识别系统时,识别效果较差,但在孤立词语音识别系统中识别效果良好,并且,由于DTW 算法计算量较少。
因此,DTW 算法在孤立词语音识别系统中得到了较为广泛的应用。
将DTW 算法移植到TMS320VC5402上实现语音识别,能满足实时性要求。
1 识别系统基本原理图1是实时语音识别系统的结构框图。
图1 语音识别系统原理框图语音信号的数字化包括预滤波和A /D 采样。
语音信号的频率一般介于100Hz ~3400H z 之间,需设计一个带通滤波器以便滤去语音信号频率以外的干扰。
语音信号经滤波和采样后,由A /D 转换器转换为二进制数字码。
语音信号的预处理一般包括预加重、加窗和分帧处理。
预加重的目的是提升高频部分,使信号的频谱变得平坦,以保持在信号的整个频带内具有同样的信噪比,便于声道参数分析。
在语音信号的数字处理中常用的是矩形窗和汉明窗等,窗口的形状、长度对短时分析参数的影响很大,为此,应选择合适的窗函数。
语音信号有10ms ~30ms 的短时平稳性,一般每秒的帧数为33帧~100帧。
矿产资源开发利用方案编写内容要求及审查大纲
矿产资源开发利用方案编写内容要求及《矿产资源开发利用方案》审查大纲一、概述
㈠矿区位置、隶属关系和企业性质。
如为改扩建矿山, 应说明矿山现状、
特点及存在的主要问题。
㈡编制依据
(1简述项目前期工作进展情况及与有关方面对项目的意向性协议情况。
(2 列出开发利用方案编制所依据的主要基础性资料的名称。
如经储量管理部门认定的矿区地质勘探报告、选矿试验报告、加工利用试验报告、工程地质初评资料、矿区水文资料和供水资料等。
对改、扩建矿山应有生产实际资料, 如矿山总平面现状图、矿床开拓系统图、采场现状图和主要采选设备清单等。
二、矿产品需求现状和预测
㈠该矿产在国内需求情况和市场供应情况
1、矿产品现状及加工利用趋向。
2、国内近、远期的需求量及主要销向预测。
㈡产品价格分析
1、国内矿产品价格现状。
2、矿产品价格稳定性及变化趋势。
三、矿产资源概况
㈠矿区总体概况
1、矿区总体规划情况。
2、矿区矿产资源概况。
3、该设计与矿区总体开发的关系。
㈡该设计项目的资源概况
1、矿床地质及构造特征。
2、矿床开采技术条件及水文地质条件。