public static double[] lpc2lpcc(double[] oneMinusA,double gain,int cepstrumOrder){
  if (cepstrumOrder <= 0) {
    throw new RuntimeException("The cepstrum order [" + cepstrumOrder + "] must be a positive integer.");
  }
  int k, m;
  double acc;
  double[] c=new double[cepstrumOrder + 1];
  int lpcOrder=oneMinusA.length - 1;
  c[0]=Math.log(gain);
  for (m=1; m <= cepstrumOrder; m++) {
    if (m <= lpcOrder) {
      acc=0.0;
      for (k=1; k < m; k++)       acc+=((m - k) * oneMinusA[k] * c[m - k]);
      c[m]=acc / (m) + oneMinusA[m];
    }
 else {
      acc=0.0;
      for (k=1; k <= lpcOrder; k++)       acc+=((m - k) * oneMinusA[k] * c[m - k]);
      c[m]=acc / (m);
    }
  }
  return (c);
}

public static double [ ] lpc2lpcc ( double [ ] oneMinusA , double gain , int cepstrumOrder ) { if ( cepstrumOrder <= 0 ) { throw new RuntimeException ( "The cepstrum order [" + cepstrumOrder + "] must be a positive integer." ) ; } int k , m ; double acc ; double [ ] c = new double [ cepstrumOrder + 1 ] ; int lpcOrder = oneMinusA . length - 1 ; c [ 0 ] = Math . log ( gain ) ; for ( m = 1 ; m <= cepstrumOrder ; m ++ ) { if ( m <= lpcOrder ) { acc = 0.0 ; for ( k = 1 ; k < m ; k ++ ) acc += ( ( m - k ) * oneMinusA [ k ] * c [ m - k ] ) ; c [ m ] = acc / ( m ) + oneMinusA [ m ] ; } else { acc = 0.0 ; for ( k = 1 ; k <= lpcOrder ; k ++ ) acc += ( ( m - k ) * oneMinusA [ k ] * c [ m - k ] ) ; c [ m ] = acc / ( m ) ; } } return ( c ) ; }
converts from lpc coefficients to lpcc coefficients .
