matlab語音識別系統(tǒng)源代碼最新版_第1頁
matlab語音識別系統(tǒng)源代碼最新版_第2頁
matlab語音識別系統(tǒng)源代碼最新版_第3頁
matlab語音識別系統(tǒng)源代碼最新版_第4頁
matlab語音識別系統(tǒng)源代碼最新版_第5頁
已閱讀5頁,還剩13頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、目錄一、設(shè)計(jì)任務(wù)及要求 1二、語音識別的簡單介紹2.1 語者識別的概念22.2 特征參數(shù)的提取 32.3 用矢量量化聚類法生成碼本 32.4 VQ的說話人識別 4三、算法程序分析3.1 函數(shù)關(guān)系 .43.2 代碼說明53.2.1 函數(shù)mfcc 53.2.2 函數(shù)disteu 53.2.3 函數(shù) vqlbg .63.2.4 函數(shù)test 63.2.5 函數(shù)testDB 73.2.6 函數(shù) train 83.2.7 函數(shù) melfb 8四、演示分析 .9五、心得體會 .11附:GUI程序代碼12設(shè)計(jì)任務(wù)及要求用MATLAB實(shí)現(xiàn)簡單的語音識別功能;具體設(shè)計(jì)要求如下:用MATLAB實(shí)現(xiàn)簡單的數(shù)字19的

2、語音識別功能二、語音識別的簡單介紹基于VQ的說話人識別系統(tǒng),矢量量化起著雙重作用.在練習(xí)階段,把每一個 說話者所提取的特征參數(shù)進(jìn)行分類, 產(chǎn)生不同碼字所組成的碼本.在識別匹配 階段,我們用VQ方法計(jì)算平均失真測度本系統(tǒng)在計(jì)算距離d時,采用歐氏距離 測度,從而判斷說話人是誰.語音識別系統(tǒng)結(jié)構(gòu)框圖如圖1所示.語苜一 數(shù)據(jù)融國預(yù)皿重、 加:又明窗訓(xùn)統(tǒng)VQ模型練習(xí)特征參數(shù)識別I識別IfVQ 碼本 匹配 U尊碼本庫;,說話人:的碼本 :說話人3的嗎本說話人W的碼本圖1語音識別系統(tǒng)結(jié)構(gòu)框圖2.1 語者識別的概念語者識別就是根據(jù)說話人的語音信號來判別說話人的身份.語音是人的自然屬性之一,由于說話人發(fā)音器官的

3、生理差異以及后天形成的行為差異,每個人的語音都帶有強(qiáng)烈的個人色彩,這就使得通過分析語音信號來識別說話人成為可 能.用語音來鑒別說話人的身份有著許多獨(dú)特的優(yōu)點(diǎn),如語音是人的固有的特征,不會喪失或遺忘;語音信號的采集方便,系統(tǒng)設(shè)備本錢低;利用 網(wǎng)絡(luò)還可實(shí) 現(xiàn)遠(yuǎn)程客戶效勞等.因此,近幾年來,說話人識別越來越多的受到人們的重視. 與其他生物識別技術(shù)如指紋識別、手形識別等相比擬,說話人識別不僅使用方便, 而且屬于非接觸性,容易被用戶接受,并且在已有的各種生物特征識別技術(shù)中, 是唯一可以用作遠(yuǎn)程驗(yàn)證的識別技術(shù).因此,說話人識別的應(yīng)用前景非常廣泛: 今天,說話人識別技術(shù)已經(jīng)關(guān)系到多學(xué)科的研究領(lǐng)域,不同領(lǐng)域中

4、的進(jìn)步都對說話人識別的開展做出了奉獻(xiàn).說話人識別技術(shù)是集聲學(xué)、語言學(xué)、計(jì)算機(jī)、信息 處理和人工智能等諸多領(lǐng)域的一項(xiàng)綜合技術(shù),應(yīng)用需求將十分廣闊.在吃力語音 信號的時候如何提取信號中關(guān)鍵的成分尤為重要.語音信號的特征參數(shù)的好壞直接導(dǎo)致了區(qū)分的準(zhǔn)確性.2.2 特征參數(shù)的提取對于特征參數(shù)的選取,我們使用 mfcc的方法來提取.MFC俸數(shù)是基于人的 聽覺特性利用人聽覺的屏蔽效應(yīng),在 Mel標(biāo)度頻率域提取出來的倒譜特征參數(shù).MFC慘數(shù)的提取過程如下:1 .對輸入的語音信號進(jìn)行分幀、加窗,然后作離散傅立葉變換,獲得頻譜 分布信息.設(shè)語音信號的DFT為:N 1j2 nkXa(k)=Z x(n)e_N-,0k

5、N-1 (1) n 1其中式中x(n)為輸入的語音信號,N表示傅立葉變換的點(diǎn)數(shù).2 .再求頻譜幅度的平方,得到能量譜.3 .將能量譜通過一組Mel尺度的三角形濾波器組.我們定義一個有M個濾波器的濾波器組(濾波器的個數(shù)和臨界帶的個數(shù)相近), 采用的濾波器為三角濾波器,中央頻率為 f(m),m=1,2,3, ,M本系統(tǒng)取M=1004 .計(jì)算每個濾波器組輸出的對數(shù)能量.N 1S(m) =ln|Xa(k) 12 Hm(k),k=12/0 -m -M -1其中Hm(k)為三角濾波器的頻率響應(yīng).5 .經(jīng)過離散弦變換(DCT得到MFCC數(shù).M 1C(n) = S (m)cos(二n(m-0.5/m),(3)

6、 m =00 n N -1MFCCS數(shù)個數(shù)通常取2030,常常不用0階倒譜系數(shù),由于它反映的是頻譜能 量,故在一般識別系統(tǒng)中,將稱為能量系數(shù),并不作為倒譜系數(shù),本系統(tǒng)選取 20階倒譜系數(shù).2.3 用矢量量化聚類法生成碼本我們將每個待識的說話人看作是一個信源,用一個碼本來表征.碼本是從該 說話人的練習(xí)序列中提取的 MFC破征矢量聚類而生成.只要練習(xí)的序列足夠長, 可認(rèn)為這個碼本有效地包含了說話人的個人特征,而與講話的內(nèi)容無關(guān).本系統(tǒng)采用基于分裂的LBG的算法設(shè)計(jì)VQ碼本,Xkk=1,2,K為練習(xí)序列,B為碼本.具體實(shí)現(xiàn)過程如下:1 .取提取出來的所有幀的特征矢量的型心均值作為第一個碼字矢量B1.

7、2 .將當(dāng)前的碼本Bm艮據(jù)以下規(guī)那么分裂,形成2m碼字.*=%+0Bm = Bm1-;其中m從1變化到當(dāng)前的碼本的碼字?jǐn)?shù),&是分裂時的參數(shù),本文8 =0.01.3 .根據(jù)得到的碼本把所有的練習(xí)序列特征矢量進(jìn)行分類,然后根據(jù)下面兩個公式計(jì)算練習(xí)矢量量化失真量的總和 Dn以及相對失真n為迭代次數(shù),初始n=0, D,=8, B為當(dāng)前的碼書,假設(shè)相對失真小于某一閾值& ,迭代結(jié)束,當(dāng)前的碼書就是設(shè)計(jì)好的2m碼字的碼書,轉(zhuǎn)5.否那么,轉(zhuǎn)下一步 量化失真量和:KD=2 mindXk,B5k 1相對失真:(6)D(nJ1) -Dn1 Dn4.重新計(jì)算各個區(qū)域的新型心,得到新的碼書,轉(zhuǎn)3.5.重復(fù)2 , 3和

8、4步,直到形成有M個碼字的碼書M是所要求的碼字?jǐn)?shù), 其中 D0=100002.4 VQ的說話人識別設(shè)是未知的說話人的特征矢量Xi,IH,Xt,共有T幀是練習(xí)階段形成的碼書,表示碼書第m個碼字,每一個碼書有M個碼字.再計(jì)算測試者的平均量化失真 D, 并設(shè)置一個閾值,假設(shè)D小于此閾值,那么是原練習(xí)者,反之那么認(rèn)為不是原練習(xí)者.D=1/TmindxjBmj11mlM三、算法程序分析在具體的實(shí)現(xiàn)過程當(dāng)中,采用了 matlab軟件來幫助完成這個工程.在matlab 中主要由采集,分析,特征提取,比對幾個重要局部.以下為在實(shí)際的操作中,具體用到得函數(shù)關(guān)系和作用一一列舉在下面.3.1 函數(shù)關(guān)系主要有兩類函數(shù)

9、文件Train.m和Test.m在Train.m 調(diào)用Vqlbg.m獲取練習(xí)錄音的vq碼本,而Vqlbg.m調(diào)用mfcc.m 獲取單個錄音的mel倒譜系數(shù),接著mfcc.m調(diào)用Melfb.m-將能量譜通過一組 Mel尺度的三角形濾波器組.在Test.m函數(shù)文件中調(diào)用Disteu.m計(jì)算練習(xí)錄音提供vq碼本與測試 錄音提供mfcc mel倒譜系數(shù)的距離,即判斷兩聲音是否為同一錄音者提供. Disteu.m 調(diào)用mfcc.m獲取單個錄音的 mel倒譜系數(shù).mfcc.m調(diào)用Melfb.m- 將能量譜通過一組Mel尺度的三角形濾波器組.3.2 具體代碼說明3.2.1 函數(shù) mffc:function

10、r = mfccs, fsm = 100;n = 256;1 = length(s);nbFrame = floor(l - n) / m) + 1; %沿-00方向取整for i = 1:nfor j = 1:nbFrameM(i, j) = s(j - 1) * m) + i); %對矩陣 M賦值end endh = hamming(n); % 力口 hamming窗,以增加音框左端和右端的連續(xù)性 M2 = diag(h) * M;for i = 1:nbFrameframe(:,i) = fft(M2(:, i); %對信號進(jìn)行快速傅里葉變換 FFTendt = n / 2;tmax =

11、 l / fs;m= melfb(20, n, fs); %等上述線性頻譜通過 Mel頻率濾波器組得到 Mel頻 譜,下面在將其轉(zhuǎn)化成對數(shù)頻譜n2 = 1 + floor(n / 2);z = m * abs(frame(1:n2, :).A2;r = dct(log(z); %將上述對數(shù)頻譜,經(jīng)過離散余弦變換(DCT)變換到倒譜域,即可得到Mel倒譜系數(shù)(MFCC#數(shù))3.2.2 函數(shù) disteu-計(jì)算測試者和模板碼本的距離function d = disteu(x, y)M, N = size(x); % M2, P = size(y); % if (M = M2)error(不匹配!音

12、頻x賦值給【M N1音頻y賦值給【M2 P】%兩個音頻時間長度不相等endd = zeros(N, P);if (N P)% 在兩個音頻時間長度相等的前提下copies = zeros(1,P);for n = 1:Nd(n,:) = sum(x(:, n+copies) - y) .A2, 1);endelsecopies = zeros(1,N);for p = 1:Pd(:,p) = sum(x - y(:, p+copies).八2, 1);end%成對歐氏距離向兩個矩陣的列之間的距離 endd = d.A0.5;3.2.3 函數(shù) vqlbg-該函數(shù)利用矢量量化提取了音頻的vq碼本fu

13、nction r = vqlbg(d,k)e = .01;r = mean(d, 2);dpr = 10000;for i = 1:log2(k)r = r*(1+e), r*(1-e);while (1 = 1)z = disteu(d, r);m,ind = min(z, , 2);t = 0;for j = 1:2Air(:, j) = mean(d(:, find(ind = j), 2);x = disteu(d(:, find(ind = j), r(:, j);for q = 1:length(x)t = t + x(q);endendif (dpr - t)/t) e)brea

14、k;elsedpr = t;endendend3.2.4 函數(shù) testfor k = 1:nfunction finalmsg = test(testdir, n, code)% read test sound file of each speaker得到測試人語音的mel倒譜系數(shù)閾值設(shè)置處就判斷一次,由于模板里面只有一個文件計(jì)算得到模板和要判斷的聲音之間的file = sprintf(%ss%d.wav, testdir, k); s, fs = wavread(file);v = mfcc(s, fs);%distmin = 4;%d = disteu(v, code1); %變換得到一

15、個距離的量“距離dist = sum(min(d,2) / size(d,1); %測試閾值數(shù)量級msgc = sprintf(與模板語音信號的差值為:10f , dist);disp(msgc);%此人匹配if dist distminmsg = sprintf(第位說話者與模板語音信號不匹配,不符合要求!n, k);finalmsg=此位說話者不符合要求!;%界面顯示語句,可隨意設(shè)定disp(msg);endend3.2.5 函數(shù) testDB這個函數(shù)實(shí)際上是對數(shù)據(jù)庫一個查詢,根據(jù)測試者的聲音,找相應(yīng)的文件,并且給 出是誰的提示function testmsg = testDB(testd

16、ir, n, code)nameList=1,2,3,4,5,6,7,8,9 ;%這個是我們要識別的9個數(shù)for k = 1:n%數(shù)據(jù)庫中每一個說話人的特征file = sprintf(%ss%d.wav, testdir, k);哦出文件的路徑s, fs = wavread(file);v = mfcc(s, fs);對找到的文件取mfcc變換distmin = inf; k1 = 0;for l = 1:length(code)d = disteu(v, codel);dist = sum(min(d,2) / size(d,1);if dist distmindistmin = dist

17、;%這里和test函數(shù)里面一樣 但多了一個具體語者的識別k1 = l;endendmsg=nameListk1msgbox(msg);end3.2.6 函數(shù) train一該函數(shù)就是對音頻進(jìn)行練習(xí),也就是提取特征參數(shù)function code = train(traindir, n)k = 16;% number of centroids requiredfor i = 1:n%對數(shù)據(jù)庫中的代碼形成碼本file = sprintf(%ss%d.wav, traindir, i);disp(file);s, fs = wavread(file);v = mfcc(s, fs); %計(jì)算MFCCs提

18、取特征特征,返回值是Mel倒譜系數(shù),是一個log的dct得到的codei = vqlbg(v, k);%練習(xí)VQ碼本 通過矢量量化,得到原說話人的VQ碼本end3.2.7 函數(shù) melfb-確定矩陣的濾波器function m = melfb(p, n, fs) f0 = 700 / fs;fn2 = floor(n/2);lr = log(1 + 0.5/f0) / (p+1);% convert to fft bin numbers with 0 for DC term bl = n * (f0 * (exp(0 1 p p+1 * lr) - 1);直接轉(zhuǎn)換為FFT的數(shù)字模型b1 = f

19、loor(bl(1) + 1;b2 = ceil(bl(2);b3 = floor(bl(3);b4 = min(fn2, ceil(bl(4) - 1;pf = log(1 + (b1:b4)/n/f0) / Ir;fp = floor(pf);pm = pf - fp;r = fp(b2:b4) 1+fp(1:b3);c = b2:b4 1:b3 + 1;v = 2 * 1-pm(b2:b4) pm(1:b3);m = sparse(r, c, v, p, 1+fn2)4、 演示分析我們的功能分為兩局部:對已經(jīng)保存的9個數(shù)字的語音進(jìn)行區(qū)分和實(shí)時的 判斷說話人說的是否為一個數(shù).在前者的實(shí)驗(yàn)過

20、程中,先把9個數(shù)字的聲音保存 成wav的格式,放在一個文件夾中,作為一個檢測的數(shù)據(jù)庫.然后對檢測者實(shí)行識 別,系統(tǒng)給出提示是哪個數(shù)字.在第二個功能中,實(shí)時的錄取一段說話人的聲音作為模板,提取mfcc特征 參數(shù),隨后緊接著進(jìn)行遇著識別,也就是讓其他人再說相同的話,看是否是原說話 者.實(shí)驗(yàn)過程及具體功能如下:先翻開Matlab使Current Directory為錄音及程序所所在的文件夾再翻開文件“ enter .m,點(diǎn)run運(yùn)行,翻開enter界面,點(diǎn)擊“進(jìn)入按 鈕進(jìn)入系統(tǒng).注:文件包未封裝完畢,目前只能通過此方式翻開運(yùn)行.如下 圖 figure1 g enterI 口 Ifigurel在對數(shù)據(jù)

21、庫中已有的語者進(jìn)行識別模塊對數(shù)據(jù)庫中已有的語者進(jìn)行識別語音庫錄制模板選擇載人語音庫語音個數(shù),錄音-test語者判定選擇載入語音庫語音個數(shù);點(diǎn)擊語音庫錄制模版進(jìn)行已存語音信息的提取;點(diǎn)擊錄首-test 進(jìn)行現(xiàn)場錄首;點(diǎn)擊語者判斷進(jìn)行判斷數(shù)字,并顯示出來 在實(shí)時語者識別模塊點(diǎn)擊實(shí)時錄制模板上的“錄音-train 按鈕,是把新語者的聲音以wav格 式存放在“實(shí)時模板文件夾中,接著點(diǎn)擊“實(shí)時錄制模板,把新的模板提取 特征值.隨后點(diǎn)擊實(shí)時語者識別模板上的“錄音 -train 按鈕,是把語者的聲音 以wav格式存放在“測試文件夾中,再點(diǎn)擊“實(shí)時語者識別,在對測得的聲音 提取特征值的同時,和實(shí)時模板進(jìn)行比對

22、,然后得出是否是實(shí)時模板中的語者. 另外面板上的播放按鈕都是播放相對應(yīng)左邊錄取的聲音.想要測量屢次,只要接著錄音,自動保存,然后程序比對音頻就可以.退出只要點(diǎn)擊菜單File/Exit ,退出程序.程序運(yùn)行截圖:(fig.2 )運(yùn)行后系統(tǒng)界面5、 心得體會實(shí)驗(yàn)說明,該系統(tǒng)能較好地進(jìn)行語音的識別,同時,基于矢量量化技術(shù) V Q的語音識別系統(tǒng)具有分類準(zhǔn)確,存儲數(shù)據(jù)少,實(shí)時響應(yīng)速度快等綜合性能好 的特點(diǎn).矢量量化技術(shù)在語音識別的應(yīng)用方面,尤其是在孤立詞語音識別系統(tǒng)中得到 很好的應(yīng)用,特別是有限狀態(tài)矢量量化技術(shù),對于語音識別更為有效.通過這次課程設(shè)計(jì),我對語音識別有了更加形象化的熟悉,也強(qiáng)化了 MATL

23、AB 的應(yīng)用,對將來的學(xué)習(xí)奠定了根底.function附:GUI程序代碼varargout = untitled2(varargin)% UNTITLED2 M-file for untitled2,fig% UNTITLED2, by itself, creates a new UNTITLED2 or raises the existing% singleton*.% H = UNTITLED2 returns the handle to a new UNTITLED2 or the handleto% the existing singleton*.% UNTITLED2(CALLBAC

24、K,hObject,eventData,handles,.) calls the local% function named CALLBACK in UNTITLED2.M with the given input arguments.% UNTITLED2(Property,Value,.) creates a new UNTITLED2 or raises the% existing singleton*. Startingfrom the left, property value pairsare% applied to the GUI before untitled2_OpeningF

25、unction gets called.An% unrecognized property name or invalid value makes property application% stop. Allinputs are passed to untitled2_OpeningFcnvia varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GUIHANDLES% Copy

26、right 2022-2022 The MathWorks, Inc.% Edit the above text to modify the response to help untitled2% Last Modified by GUIDE v2.5 08-Jun-2022 23:58:57% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name ,mfilename,.gui_Singleton, gui_Singleton,gui_OpeningFcn, untitled2

27、_OpeningFcn,gui_OutputFcn, untitled2_OutputFcn,gui_LayoutFcn,口,.gui_Callback,);if nargin & ischar(varargin1)gui_State.gui_Callback = str2func(varargin1);endif nargoutvarargout1:nargout = gui_mainfcn(gui_State, varargin:);elsegui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDI

28、T% Executes just before untitled2 is made visible.function untitled2_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and us

29、er data (see GUIDATA) % varargin command line arguments to untitled2 (see VARARGIN) % Choose default command line output for untitled2 handles.output = hObject;axes(findobj( imshow( 3.jpg axes(findobj( imshow( 1.jpg% Update handles structure guidata(hObject, handles);tag, axes13););tag, axes12););%

30、UIWAIT makes untitled2 wait for user response (see UIRESUME) % uiwait(handles.figure1);% - Outputs from this function are returned to the command line. function varargout = untitled2_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject ha

31、ndle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout1 = handles.output;% - Executes on button press in pushbutton1. function pushbutton1_Callba

32、ck(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) Channel_Str=get(handles.popupmenu3,String );Channel_Number=str2double(Channel_Strget(handles.popu

33、pmenu3,Value); global moodle; moodle = train( 模版 ,Channel_Number)%? y? o o ?6?DDi & e ?土?% - Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB

34、% handglobal data1;global moodle ;test(測試 ,1,moodle) %6 a 6 6 ? o ? i 2a % function Open_Callback(hObject, eventdata, handles)% hObject handle to Open (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) filename,pat

35、hname=uigetfile( )file=get(handles.edits,filename,pathname) y,f,b=wavread(file);% function Exit_Callback(hObject, eventdata, handles)% hObject handle to Exit (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) exit%

36、 function About_Callback(hObject, eventdata, handles) % hObject handle to About (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) H=語者識別helpdlg(H, help text ) % function File_Callback(hObject, eventdata, handles)%

37、 hObject handle to File (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% function Edit_Callback(hObject, eventdata, handles)% hObject handle to Edit (see GCBO)% eventdata reserved - to be defined in a future ver

38、sion of MATLAB% handles structure with handles and user data (see GUIDATA)function%Help_Callback(hObject, eventdata, handles)% hObject handle to Help (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % - Executes

39、on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject handle to pushbutton7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) msg=請速度錄音? msgbox(msg)clearglobal data1;%g

40、lobal dataDN1;AI = analoginput( winsound ); chan = addchannel(AI,1:2);duration = 3;%1 second acquisitionset(AI, SampleRate ,8000)ActualRate = get(AI,SampleRate );set(AI, SamplesPerTrigger ,duration*ActualRate)set(AI, TriggerType , Manual ) blocksize = get(AI,SamplesPerTrigger );Fs = ActualRate;start

41、(AI)trigger(AI)data1,time,abstime,events = getdata(AI);fname=sprintf( E:Matlab 語音識別系統(tǒng)實(shí)時模版 s1.wav)%dataDN1=wden(data1,heursure,s,one,5,sym8);denoise wavwrite(data1,fname) msgbox(fname) % - Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject hand

42、le to pushbutton8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) global data1;%global dataDN1;sound(data1)%sound(dataDN1)axes(handles.axes1) %set to plot at axes1 plot(data1);%plot(dataDN1);xlabel(練習(xí)采樣序列),ylabe

43、l( 信號幅);%xlabel(? 心a- 2e ?u Do D D),ylabel(sym8D?2 一 ?心?0 6a ?D?o? u ); grid on ;clear% - Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% hObject handle to pushbutton9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% ha

44、ndles structure with handles and user data (see GUIDATA)msg=請速度錄音?msgbox(msg)clearglobal data2;%global dataDN2;AI = analoginput( winsound );chan = addchannel(AI,1:2);duration = 3;%1 second acquisitionset(AI, SampleRate ,8000)ActualRate = get(AI,SampleRate );set(AI, SamplesPerTrigger ,duration*Actual

45、Rate)set(AI, TriggerType , Manual )blocksize = get(AI,SamplesPerTrigger );Fs = ActualRate;start(AI)trigger(AI)data2,time,abstime,events = getdata(AI);fname=sprintf( E:Matlab語音識別系統(tǒng)測試 s1.wav)%dataDN1=wden(data1,heursure,s,one,5,sym8);denoisewavwrite(data2,fname)msgbox(fname)% - Executes on button pres

46、s in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% hObject handle to pushbutton10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global data2;%global dataDN2;sound(data2)%sound(dataDN

47、2)axes(handles.axes2) %set to plot at axes1plot(data2);%plot(dataDN2);xlabel(測試采樣序列),ylabel( 信號幅);%xlabel(2a e ?2e ?u Do D D),ylabel(sym8D?2 一 ?心?o 6 心?D?o? u );% grid on ;clear% - Executes on button press in pushbutton11. function pushbutton11_Callback(hObject, eventdata, handles)% hObject handle t

48、o pushbutton11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) global moodle ;testDB(測試 ,1,moodle)% - Executes on button press in pushbutton12.function pushbutton12_Callback(hObject, eventdata, handles)% hObject

49、 handle to pushbutton12 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global moodle;moodle = train( 實(shí)時模板 ,1)% - Executes on selection change in popupmenu3.function popupmenu3_Callback(hObject, eventdata, handles)% hObject handle to popupmenu3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,String)returns popupmenu3

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論