⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decod_acelp.m

📁 这是一段G.729A的编码和解码仿真程序
💻 M
字号:
function c=Decod_ACELP(S,C)
%/*-----------------------------------------------------------*
% *  Function  Decod_ACELP()                                  *
% *  ~~~~~~~~~~~~~~~~~~~~~~~                                  *
% *   Algebraic codebook decoder.                             *
% *----------------------------------------------------------*/

% (i):S signs of 4 pulses.   C  Positions of the 4 pulses. 
% (o):algebraic (fixed) codebook excitation

c=zeros(1,40);
S1=bin_dec(S(1),1);
S2=bin_dec(S(2),1);
S3=bin_dec(S(3),1);
S4=bin_dec(S(4),1);
if S1==0
    s3=-1;
else s3=1;
end
if S2==0
    s2=-1;
else s2=1;
end
if S3==0
    s1=-1;
else s1=1;
end
if S4==0
    s0=-1;
else s0=1;
end

%  /* Decode the positions */
m0=(bin_dec(C(11:13),3))*5+1;
m1=(bin_dec(C(8:10),3))*5+2;
m2=(bin_dec(C(5:7),3))*5+3;
jx=bin_dec(C(4),1);
if jx==0
    m3=(bin_dec(C(1:3),3))*5+4;
else m3=(bin_dec(C(1:3),3))*5+5;
end

%/* decode the signs  and build the codeword */
c(m0)=s0;c(m1)=s1;c(m2)=s2;c(m3)=s3;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -