clear all; n9=auread('miners.au',13281); lenn9=length(n9); if length(n9)>13280; lenn9=13280; end tkrx=lenn9/160; tkrx=floor(tkrx); er(1:round(lenn9))=0; for i=1:23, M(i)=1+(i-1)*7; end hmmg=hamming(240); e(1:160)=0; hw1(1:320)=0; for prcss=1:tkrx, tempx=(prcss-1)*160; tempx s(1:160)=0; s=n9(tempx+1:tempx+160)'; %for ppo=1:160, % s(ppo)=s(ppo)*hmmg(ppo+40); %end N=160; a=lpc(s(1:N),10); tempy=(prcss-1)*10; atemp(tempy+1:tempy+10)=-a(2:11); e(1)=1; hj=az160(a,e); hw1(161:320)=hj(1:160); e(1)=0; psi(1:length(M))=0; for syc=1:length(M), for n=1:160, psi(syc)=psi(syc)+s(n)*hw1(161-M(syc)+n); end end clear epsi; epsi(length(M),length(M))=0; for syc=1:length(M), for syc2=1:length(M), for g=1:160, epsi(syc,syc2)=epsi(syc,syc2)+hw1(161-M(syc)+g)*hw1(161-M(syc2)+g); end end end epsi2=inv(epsi); gi=psi*epsi2; for syc=1:length(M), er(M(syc)+tempx)=gi(syc); end %end tekrar end %algorithm is finished %now synthesise waveform uzunluk=length(atemp); syc=floor(uzunluk/10); hmmg=hamming(240); for cnt=1:syc, lpcsyc=(cnt-1)*10; excsyc=(cnt-1)*160; alpc=[1 -atemp(lpcsyc+1:lpcsyc+10)]; exc=er(excsyc+1:excsyc+160); sn(excsyc+1:excsyc+160)=az160(alpc,exc); end subplot(3,1,1),plot(sn); subplot(3,1,2),plot(n9(1:length(sn)));