g = sqrt(corr/(e0+10));
g = sqrt(g1*corr/(e0+10));
void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, float *gain, int N, float *stack){   int i,j,k;   float corr;   float energy;   float score, *best_score;   float e0;   best_score = PUSH(stack,N);   for (i=0;i<N;i++)        best_score[i]=-1;   energy=xcorr(sw-start, sw-start, len);   e0=xcorr(sw, sw, len);   for (i=start;i<=end;i++)   {      corr=xcorr(sw, sw-i, len);      score=corr*corr/(energy+1);      if (score>best_score[N-1])      {         float g1, g;         g1 = corr/(energy+10);         g = sqrt(corr/(e0+10));         if (g>g1)            g=g1;         if (g<0)            g=0;         for (j=0;j<N;j++)         {            if (score > best_score[j])            {               for (k=N-1;k>j;k--)               {                  best_score[k]=best_score[k-1];                  pitch[k]=pitch[k-1];                  gain[k] = gain[k-1];               }               best_score[j]=score;               pitch[j]=i;               gain[j]=g;               break;            }         }      }      /* Update energy for next pitch*/      energy+=sw[-i-1]*sw[-i-1] - sw[-i+len-1]*sw[-i+len-1];   }   POP(stack);}