資源簡介
使用matlab編寫語音識別項目,可以進行孤立語音識別實驗,可以識別單詞和數字等。也可以在我的項目之上進行改進和改善。

代碼片段和文件信息
function?[?alpha?alpham?nalpham?alphac?]?=?alpharec(?A?B?Pi?)
%?alpharec?This?function?returns?the?alpha?matrix?for?an?HMM
%
%???The?following?parameters?are?used?for?annotation
%???N????:?Numer?of?states?in?HMM
%???T????:?Number?of?observations?(in?the?HW?it?is?written?Mw)
%???Q????:?States?in?the?HMM
%???x????:?observations?in?the?HMM
%???x(i)?:?the?observation?for?frame/time?i
%???j????:?current?state
%???i????:?previous?state
%
%???The?following?parameters?are?passed?to?the?function
%???A?:?NxN?transition?matrix?describing?the?pobality?that?the?next
%???????state?is?Q(j)?given?that?the?previous?state?is?Q(i)?or?a(ij).
%???B?:?NxT?Observation?probability?matrix?describing?the?probaility?that?
%???????we?get?observation?x(t)?given?that?the?current?state?is?Q(j)
%???Pi:?1xN?initial?probability?matrix.??This?matrix?is?non?negative?and
%???????sums?to?1.??It?gives?the?probability?that?we?start?in?Pi(n).
%
%???The?following?paramters?are?returned?by?the?function
%???alpham?:?a?NxT?matrix?representing?the?alpha?value?given?(jt)
%????????????which?is?the?proposed?state?and?the?current?time/frame
%???alpha??:?a?scalar?that?represents?the?summation?of?all?values
%??????????:?in?alpham?for?the?HMM
%???First?we?initialize?the?first?column?of?alpha?with:
%??????alpham(1j)?=?p(j)*p(x(1)|j)
%???The?we?recursively?move?forward?across?the?matrix?with:
%??????alpham(tj)?=?p(x(t)|j)*sum(alpha(i)*p(j|i)?from?i=1:N)???
t?=?1;?%?the?current?frame/time
j?=?1;?%?the?current?state
[N?T]?=?size(B);?%?the?number?of?states?and?observations?in?the?HMM
alpham?=?zeros(N?T);
nalpham?=?zeros(N?T);
%?to?avoid?underflow?the?alpha?matrix?values?are?all?normalized?to?1
%?these?normalization?factors?are?also?passed?to?the?beta?matrices
alphac?=?zeros(1?T);
%?code?adapted?from?http://www.shokhirev.com/nikolai/abc/alg/hmm/HMM_cpp.html
%?initialize?the?first?column?of?the?alpha?vector;
for?j?=?1:N
???alpham(j?t)?=?Pi(j)*B(jt);
???nalpham(j?t)?=?Pi(j)*B(jt);
???alphac(1?t)?=?alphac(1?t)?+?alpham(j?t);
end
for?j?=?1:N
????alpham(j?t)?=?alpham(jt)/alphac(1t);
end
%?recursively?move?forward?across?the?matrix
for?t?=?1:T-1
????for?j?=?1:N
????????sum1?=?0;
????????sum2?=?0;
????????for?i?=?1:N
????????????sum1?=?sum1+alpham(it)*A(ij);
????????????sum2?=?sum2?+?nalpham(it)*A(ij);
????????end
????????alpham(jt+1)?=?sum1*B(jt+1);
????????nalpham(jt+1)?=?sum2*B(jt+1);
????????alphac(1?t+1)?=?alphac(1?t+1)?+?alpham(j?t+1);
????end
????%?apply?scalar?values?to?each?state?at?time?t
????for?j?=?1:N
????????alpham(j?t+1)?=?alpham(jt+1)/alphac(1t+1);
????end
end
%?termination
%?t?=?T;
%?alpha?=?0;
%?for?j?=?1:N
%?????alpha?=?alpha?+?alpham(jt);
%?end
%?for?the?scaled?vector?we?can?now?use?the?product?of?the?scalars
%?to?find?our?total?probability?of?obesrving?the?given?events
alpha?=?sum(log(alphac));
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-08-26?00:37??MySpeechRecognition-master\
?????文件???????64044??2015-08-26?00:37??MySpeechRecognition-master\?test.wav
?????文件?????????302??2015-08-26?00:37??MySpeechRecognition-master\.gitignore
?????目錄???????????0??2015-08-26?00:37??MySpeechRecognition-master\Matlab\
?????文件???????11264??2015-08-26?00:37??MySpeechRecognition-master\Matlab\EMTraining.m
?????文件????????1328??2015-08-26?00:37??MySpeechRecognition-master\Matlab\HMMgammaposteri.m
?????文件?????????598??2015-08-26?00:37??MySpeechRecognition-master\Matlab\HMMtest.m
?????文件????????1781??2015-08-26?00:37??MySpeechRecognition-master\Matlab\HMMxiposteri.m
?????文件????????1099??2015-08-26?00:37??MySpeechRecognition-master\Matlab\Homework4.m
?????文件?????????830??2015-08-26?00:37??MySpeechRecognition-master\Matlab\UpdatePi.m
?????文件????????2852??2015-08-26?00:37??MySpeechRecognition-master\Matlab\alpharec.m
?????文件????????2370??2015-08-26?00:37??MySpeechRecognition-master\Matlab\betarec.m
?????文件?????????860??2015-08-26?00:37??MySpeechRecognition-master\Matlab\filterbankmulttest.m
?????文件???????16522??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four.wav
?????文件???????18040??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four10.wav
?????文件???????17036??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four2.wav
?????文件???????16410??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four3.wav
?????文件???????17514??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four4.wav
?????文件???????17102??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four5.wav
?????文件???????17156??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four6.wav
?????文件???????17670??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four7.wav
?????文件???????17586??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four8.wav
?????文件???????17742??2015-08-26?00:37??MySpeechRecognition-master\Matlab\four9.wav
?????文件????????3003??2015-08-26?00:37??MySpeechRecognition-master\Matlab\fourlambda.mat
?????文件?????????876??2015-08-26?00:37??MySpeechRecognition-master\Matlab\gMeanAndVar.m
?????文件????????1501??2015-08-26?00:37??MySpeechRecognition-master\Matlab\melfilterbank.m
?????文件????????1240??2015-08-26?00:37??MySpeechRecognition-master\Matlab\melfrequencies.m
?????文件????????3171??2015-08-26?00:37??MySpeechRecognition-master\Matlab\my_mfcc.m
?????文件???????11746??2015-08-26?00:37??MySpeechRecognition-master\Matlab\one.wav
?????文件???????12214??2015-08-26?00:37??MySpeechRecognition-master\Matlab\one10.wav
?????文件???????12726??2015-08-26?00:37??MySpeechRecognition-master\Matlab\one2.wav
............此處省略44個文件信息
- 上一篇:語音識別matlab
- 下一篇:元胞自動機的Matlab代碼.m
評論
共有 條評論