資源簡介
CELP語音編碼,MATLAB程序,可直接運(yùn)行,

代碼片段和文件信息
function?[synth_e0]=CBsearch(sube0)
%?This?search?routine?is?based?on?algebraic?ternary?codebook?search.?No?real?codebook?exists!
%?Please?refer?to?the?following?reference
%?Y-H.?Kao?Low?Complexity?CELP?Speech?Coding?at?4.8?kbps?Master?thesis?1992?University?of?Maryland
global?h?szsubf?subvec?nzero?numsubv?cindex?cgain?sub_cnt
%?For?the?first?sub-frame?which?is?empty?just?assume?a?stoch?code
if?sub_cnt==1???????
????cindex(sub_cnt)=512;
????cgain(sub_cnt)=-1;
else
????
????%?Each?subframe?(60)?is?divided?into?3?sub-vectors(20).?Only?4?points?in?each?vector?are?1?or?-1;
????offset=subvec/nzero;
????for?i=1:szsubf/(subvec/nzero)???????????????????
????????wex(i)=sube0((i-1)*offset+1:i*offset)*h(1:offset)‘;???????????%?Weight?the?error?signal
????end
????%?Compute?cross-correlation?of?error?signal?and?code?on?sub-vector?level
????for?i=1:numsubv
????????sub(i1)=wex((i-1)*nzero+1)+wex((i-1)*nzero+2)+wex((i-1)*nzero+3)+wex((i-1)*nzero+4);????
????????sub(i2)=wex((i-1)*nzero+1)+wex((i-1)*nzero+2)-wex((i-1)*nzero+3)-wex((i-1)*nzero+4);
????????sub(i3)=wex((i-1)*nzero+1)-wex((i-1)*nzero+2)+wex((i-1)*nzero+3)-wex((i-1)*nzero+4);
????????sub(i4)=wex((i-1)*nzero+1)-wex((i-1)*nzero+2)-wex((i-1)*nzero+3)+wex((i-1)*nzero+4);
????????sub(i5)=-wex((i-1)*nzero+1)+wex((i-1)*nzero+2)+wex((i-1)*nzero+3)-wex((i-1)*nzero+4);
????????sub(i6)=-wex((i-1)*nzero+1)+wex((i-1)*nzero+2)-wex((i-1)*nzero+3)+wex((i-1)*nzero+4);
????????sub(i7)=-wex((i-1)*nzero+1)-wex((i-1)*nzero+2)+wex((i-1)*nzero+3)+wex((i-1)*nzero+4);
????????sub(i8)=-wex((i-1)*nzero+1)-wex((i-1)*nzero+2)-wex((i-1)*nzero+3)-wex((i-1)*nzero+4);
????end
????
????%?Compute?cross-correlation?of?error?signal?and?code?on?subframe?level
????for?i=1:8
????????for?j=1:8
????????????for?k=1:8
????????????????cor((i-1)*8*8+(j-1)*8+k)=sub(1i)+sub(2j)+sub(3k);
????????????end
????????end
????end
????%?Find?the?best?estimate
????eng=12*sum(h(1:5).^2);
????gain=cor/eng;
????[pkcindex(sub_cnt)]=max(cor.*gain);
????cgain(sub_cnt)=gain(cindex(sub_cnt));
????
end
%?Given?the?best?estimate?of?stoch?code?and?gain?synthesize?the?stochastic?excitation
synth_e0=exc_syn(cindex(sub_cnt)cgain(sub_cnt));
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-04-10?21:07??CELP語音編碼\
?????文件????????2231??2015-03-30?08:21??CELP語音編碼\CBsearch.m
?????文件????????1329??2015-03-30?08:21??CELP語音編碼\celp.m
?????文件????????1499??2015-03-30?08:21??CELP語音編碼\decoder.m
?????文件????????1077??2015-03-30?08:21??CELP語音編碼\encoder.m
?????文件????????1198??2015-03-30?08:21??CELP語音編碼\exc_syn.m
?????文件?????????354??2015-03-30?08:21??CELP語音編碼\FIRfilter.M
?????文件?????????302??2015-03-30?08:21??CELP語音編碼\impulse.m
?????文件????????4511??2015-03-30?08:21??CELP語音編碼\init.m
?????文件??????????61??2015-03-30?08:21??CELP語音編碼\initdec.m
?????文件?????????835??2015-03-30?08:21??CELP語音編碼\initsub.m
?????文件?????????857??2015-03-30?08:21??CELP語音編碼\interpolate.m
?????文件?????????312??2015-03-30?08:21??CELP語音編碼\lpcr.m
?????文件?????????473??2015-03-30?08:21??CELP語音編碼\lpc_ana.m
?????文件????????3209??2015-03-30?08:21??CELP語音編碼\pdetect.m
?????文件????????1580??2015-03-30?08:21??CELP語音編碼\pitch_syn.m
?????文件????????1304??2015-03-30?08:21??CELP語音編碼\postfilt.m
?????文件????????2502??2015-03-30?08:21??CELP語音編碼\psearch.m
?????文件????????1149??2015-03-30?08:21??CELP語音編碼\scramble_code.m
?????文件????????1062??2015-03-30?08:21??CELP語音編碼\subcoding.m
?????文件?????????127??2015-03-30?08:21??CELP語音編碼\wcoff.m
評論
共有 條評論