资源简介
CELP语音编码,MATLAB程序,可直接运行,
代码片段和文件信息
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
- 上一篇:电力系统负荷预测MATLAB程序 .m
- 下一篇:异步电机spwm控制仿真
评论
共有 条评论