lpc1.m
上传用户:luvkyhj
上传日期:2013-06-25
资源大小:3k
文件大小:1k
- function lpc=lpc1(x)
- x=double(x);
- x=x/max(abs(x));
- x=filter([1 -0.9375],1,x);
- w=1/6+sin(pi*[1:12]./12);
- w=w/max(w);
- w=w*0.375;
- [x1,x2]=vad(x);
- y=enframe(x,160,80);
- x2=floor(x2);
- r=zeros(x2-x1+1,320-1);
- for m=x1:x2
- xs=y(m,:);
- r(m-x1+1,:)=xcorr(xs,'biased');
- end
- rr=zeros(x2-x1+1,13);
- for m=1:x2-x1+1
- rr(m,:)=r(m,160:172);
- end
- for i=1:x2-x1+1
- k(1)=rr(i,2)/rr(i,1);
- a(1,1)=k(1);
- lamg(1)=(1-k(1)*k(1))*rr(i,1);
- for m=2:12
- sum=0;
- for j=1:m-1
- sum=sum+a(j,m-1)*rr(i,m-j+1);
- end
- k(m)=(rr(i,m+1)-sum)/lamg(m-1);
- a(m,m)=k(m);
- for p=1:m-1
- a(p,m)=a(p,m-1)-k(m)*a(m-p,m-1);
- end
- lamg(m)=(1-k(m)*k(m))*lamg(m-1);
- end
- for m=1:12
- lpc(i,m)=-a(m,12);
- end
- end
-