void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack)
void open_loop_nbest_pitch(spx_sig_t *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack)
void open_loop_nbest_pitch(float *sw, int start, int end, int len, int *pitch, float *gain, int N, char *stack){   int i,j,k;   /*float corr=0;*/   /*float energy;*/   float *best_score;   float e0;   float *corr, *energy, *score;   best_score = PUSH(stack,N, float);   corr = PUSH(stack,end-start+1, float);   energy = PUSH(stack,end-start+2, float);   score = PUSH(stack,end-start+1, float);   for (i=0;i<N;i++)   {        best_score[i]=-1;        gain[i]=0;   }   energy[0]=inner_prod(sw-start, sw-start, len);   e0=inner_prod(sw, sw, len);   for (i=start;i<=end;i++)   {      /* Update energy for next pitch*/      energy[i-start+1] = energy[i-start] + sw[-i-1]*sw[-i-1] - sw[-i+len-1]*sw[-i+len-1];   }   for (i=start;i<=end;i++)   {      corr[i-start]=0;      score[i-start]=0;   }   for (i=start;i<=end;i++)   {      /* Compute correlation*/      corr[i-start]=inner_prod(sw, sw-i, len);      score[i-start]=corr[i-start]*corr[i-start]/(energy[i-start]+1);   }   for (i=start;i<=end;i++)   {      if (score[i-start]>best_score[N-1])      {         float g1, g;         g1 = corr[i-start]/(energy[i-start]+10);         g = sqrt(g1*corr[i-start]/(e0+10));         if (g>g1)            g=g1;         if (g<0)            g=0;         for (j=0;j<N;j++)         {            if (score[i-start] > 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[i-start];               pitch[j]=i;               gain[j]=g;               break;            }         }      }   }}