% Pulse position are predetermined % this program calculates the pulse gains clear all; j=0:159; b=j.*(pi/80); s=15*sin(b); s10=s; tkrx=1; er(1:160)=0; %Pulse positions for i=1:10; M(i)=1+(i-1)*16; end e(1:160)=0; hw1(1:320)=0; prcss=1; tempx=0; 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 xcoord=0:159; subplot(3,1,1), plot(xcoord,s10,'-',xcoord,az160(a,er),'o'); subplot(3,1,2), plot(er); subplot(3,1,3), plot(s3-az160(a,er));