/* Compute power spectrum of a half-complex (packed) vector  */
static void power_spectrum(const spx_word16_t *X, spx_word32_t *ps, int N)
/* Compute power spectrum of a half-complex (packed) vector  */
static void power_spectrum(const spx_word16_t *X, spx_word32_t *ps, int N)
{
   int i, j;
   ps[0]=MULT16_16(X[0],X[0]);
   for (i=1,j=1;i<N-1;i+=2,j++)
   {
      ps[j] =  MULT16_16(X[i],X[i]) + MULT16_16(X[i+1],X[i+1]);
   }
   ps[j]=MULT16_16(X[i],X[i]);
}