         Name: LGSOL1
         Type: Assembler Program
      Version: 2.0
 Date Entered: 15-Mar-87
  Last Change: 21-May-87 (improved speed)

  Description: Leroux-Gueguen Solution for PARCOR (LPC) Coefficients

 This program uses the the Leroux-Gueguen algorithm to find a set of
 PARCOR coefficients given an autocorrelation vector.  These
 PARCOR coefficients can be used in speech analysis/synthesis systems
 such as: vocoding, stochastic speech coding, multipulse speech
 coding, speech recognition, etc.

 This program will solve any order system by equating the
 order "NK" to the number of K coefficients desired.  The program
 is written as an illustrative example and the user may 
 change the routine as needed.  The program will:

  1. Read a data file to determine how many sets of coefficients
     to calculate.
  2. Read the autocorrelations from a data file.
  3. Perform the Leroux-Gueguen algorithm to find the K's.
  4. Output the K coefficients to a data file.
  5. Continue steps 2,3,4 for the number of specified sets of 
     coefficients.

 The explanation of the algorithm is beyond the scope of this
 help file but the coding of the algorithm can be easily
 understood by examining the FORTRAN subroutine below (LGSOL).  This
 coding of the Leroux-Gueguen algorithm is a modified version
 of the source code presented at the 1987 IEEE International
 Conference on Acoustics, Speech and Signal Processing (ICASSP 87) [1].
 The source code was then modified to split out the array indexes and
 references to the loop indexes.  These variables were then
 replaced with separate addressing variables as shown in the FORTRAN
 source code below (LGSOL1).  These separate variables become address
 registers in the DSP56000/1 address ALU.  This provides an easy
 method for converting a FORTRAN source program to DSP56000/1 code.

 Approximate execution times for LGSOL1 on a 20.5 Mhz DSP56000/1 are:

 NK = 8,  8th  order: 46.2  uS 
 NK = 10, 10th order: 61.6  uS 
 NK = 16, 16th order: 117.2 uS
  
 Original FORTRAN source program (with slight modifications):

       subroutine lgsol(r,n,fk)
       dimension r(0:*),fk(*),bim1(14),bi(14)
 
       fk(1)=-r(1)/r(0)
       bim1(1)=r(1)
       bim1(2)=r(0)+fk(1)*r(1)
       do 5 i=2,n
           yi=r(i)
           bi(1)=yi
           im1=i-1
           do 4 j=1,im1
             bi(j+1)=bim1(j)+fk(j)*yi
             yi=yi+fk(j)*bim1(j)
             bim1(j)=bi(j)
 4          continue
           fk(i)=-yi/bim1(i)
           bim1(i+1)=bim1(i)+fk(i)*yi
           bim1(i)=bi(i)
 5      continue
       return
       end
 
 Modified FORTRAN source for direct DSP56000/1 conversion:

       subroutine lgsol1(r,n,fk)
       parameter numk=8
       dimension r(0:*),fk(*),bim1(numk+1),bi(numk)
 
       ifk=1
       fk(ifk)=-r(1)/r(0)
       ibim1=1
       bim1(ibim1)=r(1)
       ibim1=ibim1+1
       bim1(ibim1)=r(0)+fk(ifk)*r(1)
       ifk=ifk+1
       irptr=2
       im1=1
       ibi=2
       do 5 i=1,im1
           yi=r(irptr)
           irptr=irptr+1
           jbi=1
           bi(jbi)=yi
           jbi=jbi+1
           jbm1=1
           jfk=1
           do 4 j=1,im1
             bi(jbi)=bim1(jbm1)+fk(jfk)*yi
             jbi=jbi-1
             yi=yi+fk(jfk)*bim1(jbm1)
             bim1(jbm1)=bi(jbi)
             jbm1=jbm1+1
             jfk=jfk+1
             jbi=jbi+2
 4          continue
           fk(ifk)=-yi/bim1(ibim1)
           bim1(ibim1+1)=bim1(ibim1)+fk(ifk)*yi
           bim1(ibim1)=bi(ibi)
           ibim1=ibim1+1
           ibi=ibi+1
           im1=im1+1
           ifk=ifk+1
 5      continue
       return
       end

 References
 ----------
 [1]  L. R. Morris, P. Barszczewski and J. Bosloy, "Algorithm Selection
 and Software Time/Space Optimization for a DSP Micro-Based Speech
 Processor for a Multi-Electrode Cochlear Implant," Proceedings of the
 1987 IEEE International Conference on Acoustics, Speech and Signal
 Processing (ICASSP87), paper 22.B4, pp. 972-975.

