📄 lpc_1a.m
字号:
function [cofa,rc1,energy,residue]= lpc_1a(sso,norder);
% Linear prediction (corvariance method),
% fixed order (=13).
% Input == Speech Signal
% Output ==
% cofa : AR cofficients
% rc1 : first reflection coefficient
% energy : energy of the underlying speech segment
% residue : the prediction error
sso=sso(:);
sso1=sso(norder+1:length(sso));
energy=sso1'*sso1;
rc1=sso1(1:length(sso1)-1)'*sso1(2:length(sso1))/energy;
%ssa=sso(:); removed by john 4/15/93 with hu's ok
maxordera =norder;
%N=length(ssa)-maxordera;
N=length(sso)-maxordera;
% allocate memory (john did this ...)
U = zeros(N,maxordera+1);
V = U;
B = zeros(maxordera+1,maxordera+1);
for k=1:maxordera+1
%U(1:N,k) =ssa(k:N+k-1);
U(1:N,k) =sso(k:N+k-1);
end;
V(:,1)=U(:,1);
rp(1)=V(:,1)'*V(:,1);
for k=1:maxordera+1
V(:,k)=U(:,k);
for i=1:k-1
B(k,i)=(U(:,k)'*V(:,i))/(V(:,i)'*V(:,i));
V(:,k)=V(:,k)-B(k,i)*V(:,i);
end
B(k,k)=1;
end;
ordera=norder+1;
residue=V(1:length(V), ordera).';
ordera=ordera-1;
bb= B(1:ordera,1:ordera);
invB=inv(bb);
pb=B(ordera+1,1:ordera);
cofb=pb*invB;
cofa=[1 -cofb(ordera:-1:1)];
cofa1=polystab(cofa);
if any(cofa-cofa1)
cofa=cofa1;
rr=filter(cofa1,1,sso);
rr=rr(maxordera+1:length(rr));
residue=rr(:)';
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -