📄 decode.m
字号:
function decode(v,pitch_marks,bvalue,corparameter1,corparameter2,poles_num,frmsize,win_length)
syms z;
syms n;
Bz=1-bvalue*z^(-pitch_marks);%prediction error filter
bnreciprocal=iztrans(1/Bz,z,n)%short trem prediction error
%caculate A
Az1=1;
Az2=1;
for k=1:poles_num
Az1=Az1-corparameter1(k)*z^(-k);
Az2=Az2-corparameter2(k)*z^(-k);
end
%caculate u[n] ,that is e[n]
un1=zeros(1,win_length);
un2=zeros(1,win_length);
for i=1:pitch_marks
% bnre(i)=
subs(bnreciprocal,n,i)
%un(i)=conv(v,bnre)
% if i<=win_length
%un1(i)=conv(v(i),bnre)
%else
%bnre=subs(bnreciprocal,n,i-win_length)
%un2(i-win_length)=conv(v(i),bnre)
%end
end
%caculate the z transfrom of un1 and un2
Uz1=simple(ztrans(un1,n,z));
Uz2=simple(ztrans(un2,n,z));
%caculate the predict value of sn
Sz1=Uz1*(1/Az1);
Sz2=Uz2*(1/Az2);
sn1=iztrans(Sz1,z,n);
sn2=iztrans(Sz2,z,n);
sn=zeros(1,frmsize);
for i=1:frmsize
if i<=win_length
sn(i)=subs(sn1,n,i);
else
sn(i)=subs(sn2,n,i-win_length);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -