aRts audio server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
656B

  1. #include "gsl/gslfft.h"
  2. #include "fft.h"
  3. void arts_fft_float (
  4. unsigned NumSamples,
  5. int InverseTransform,
  6. float *RealIn,
  7. float *ImagIn,
  8. float *RealOut,
  9. float *ImagOut )
  10. {
  11. double *ri_in = g_newa(double, NumSamples*4);
  12. double *ri_out = ri_in + NumSamples*2;
  13. unsigned int i;
  14. for(i = 0; i < NumSamples; i++)
  15. {
  16. ri_in[2*i] = RealIn[i];
  17. ri_in[2*i+1] = (ImagIn?ImagIn[i]:0.0);
  18. }
  19. if(InverseTransform == 0)
  20. gsl_power2_fftac (NumSamples, ri_in, ri_out);
  21. else
  22. gsl_power2_fftsc (NumSamples, ri_in, ri_out);
  23. for(i = 0; i < NumSamples; i++)
  24. {
  25. RealOut[i] = ri_out[2*i];
  26. ImagOut[i] = ri_out[2*i+1];
  27. }
  28. }