private double computeOneFrameDistance(double[] l1,double[] l2,boolean isBark,double upperFreqInHz){
  int maxInd1=MathUtils.getLargestIndexSmallerThan(l1,upperFreqInHz);
  int maxInd2=MathUtils.getLargestIndexSmallerThan(l2,upperFreqInHz);
  int maxInd=Math.min(maxInd1,maxInd2);
  double[] tmp1;
  double[] tmp2;
  if (maxInd + 1 == l1.length) {
    tmp1=l1;
  }
 else {
    tmp1=new double[maxInd + 1];
    System.arraycopy(l1,0,tmp1,0,maxInd + 1);
  }
  if (maxInd + 1 == l2.length) {
    tmp2=l2;
  }
 else {
    tmp2=new double[maxInd + 1];
    System.arraycopy(l2,0,tmp2,0,maxInd + 1);
  }
  double distance;
  if (!isBark) {
    distance=SignalProcUtils.getRmsDistance(tmp1,tmp2);
  }
 else {
    distance=SignalProcUtils.getRmsDistance(SignalProcUtils.freq2bark(tmp1),SignalProcUtils.freq2bark(tmp2));
  }
  return distance;
}

private double computeOneFrameDistance ( double [ ] l1 , double [ ] l2 , boolean isBark , double upperFreqInHz ) { int maxInd1 = MathUtils . getLargestIndexSmallerThan ( l1 , upperFreqInHz ) ; int maxInd2 = MathUtils . getLargestIndexSmallerThan ( l2 , upperFreqInHz ) ; int maxInd = Math . min ( maxInd1 , maxInd2 ) ; double [ ] tmp1 ; double [ ] tmp2 ; if ( maxInd + 1 == l1 . length ) { tmp1 = l1 ; } else { tmp1 = new double [ maxInd + 1 ] ; System . arraycopy ( l1 , 0 , tmp1 , 0 , maxInd + 1 ) ; } if ( maxInd + 1 == l2 . length ) { tmp2 = l2 ; } else { tmp2 = new double [ maxInd + 1 ] ; System . arraycopy ( l2 , 0 , tmp2 , 0 , maxInd + 1 ) ; } double distance ; if ( ! isBark ) { distance = SignalProcUtils . getRmsDistance ( tmp1 , tmp2 ) ; } else { distance = SignalProcUtils . getRmsDistance ( SignalProcUtils . freq2bark ( tmp1 ) , SignalProcUtils . freq2bark ( tmp2 ) ) ; } return distance ; }
compute the distance between two lsf frames
