Einzelnen Beitrag anzeigen

Newbie44
(Gast)

n/a Beiträge
 
#3

Re: nochmal c++ nach delphi

  Alt 22. Jun 2005, 14:29
DAs hauptproblem dabei ist für mich dieser absatz:

Delphi-Quellcode:
void imdct_init()
{
   int i, k;
   complex_t angle_step;
   complex_t current_angle;

   /* Twiddle factors to turn IFFT into IMDCT */
   for(i=0; i<128; i++)
   {
      xcos1[i] = cos(2.0 * M_PI * (8*i+1)/(8*N));
      xsin1[i] = sin(2.0 * M_PI * (8*i+1)/(8*N));
   }

   
   /* More twiddle factors to turn IFFT into IMDCT */
   for(i=0; i<64; i++)
   {
      xcos2[i] = cos(2.0 * M_PI * (8*i+1)/(4*N));
      xsin2[i] = sin(2.0 * M_PI * (8*i+1)/(4*N));
   }


   /* Canonical twiddle factors for FFT */
   w[0] = w_1;
   w[1] = w_2;
   w[2] = w_4;
   w[3] = w_8;
   w[4] = w_16;
   w[5] = w_32;
   w[6] = w_64;

   for( i = 0; i < 7; i++)
   {
      angle_step.real = cos(-2.0 * M_PI / (1 << (i+1)));
      angle_step.imag = sin(-2.0 * M_PI / (1 << (i+1)));

      current_angle.real = 1.0;
      current_angle.imag = 0.0;

      for (k = 0; k < 1 << i; k++)
      {
         w[i][k] = current_angle;
         current_angle = cmplx_mult(current_angle, angle_step);
      }

   }

   ZeroMemory(&delay, sizeof(delay));
}

void imdct_do_512(double data[], double delay[])
{
   int i, k;
   int p, q;
   int m;
   int two_m;
   int two_m_plus_one;

   double tmp_a_i, tmp_a_r, tmp_b_i, tmp_b_r;
   double *data_ptr, *delay_ptr, *window_ptr;
da steht so viel drinnen da blick ich nicht so richtig durch
  Mit Zitat antworten Zitat