fft.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the ../../../LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. /*--------------------------------*-C-*---------------------------------*
  11. * File:
  12. * fftn.h
  13. * ---------------------------------------------------------------------*
  14. * Re[]: real value array
  15. * Im[]: imaginary value array
  16. * nTotal: total number of complex values
  17. * nPass: number of elements involved in this pass of transform
  18. * nSpan: nspan/nPass = number of bytes to increment pointer
  19. * in Re[] and Im[]
  20. * isign: exponent: +1 = forward -1 = reverse
  21. * scaling: normalizing constant by which the final result is *divided*
  22. * scaling == -1, normalize by total dimension of the transform
  23. * scaling < -1, normalize by the square-root of the total dimension
  24. *
  25. * ----------------------------------------------------------------------
  26. * See the comments in the code for correct usage!
  27. */
  28. #ifndef MODULES_THIRD_PARTY_FFT_FFT_H_
  29. #define MODULES_THIRD_PARTY_FFT_FFT_H_
  30. #define FFT_MAXFFTSIZE 2048
  31. #define FFT_NFACTOR 11
  32. typedef struct {
  33. unsigned int SpaceAlloced;
  34. unsigned int MaxPermAlloced;
  35. double Tmp0[FFT_MAXFFTSIZE];
  36. double Tmp1[FFT_MAXFFTSIZE];
  37. double Tmp2[FFT_MAXFFTSIZE];
  38. double Tmp3[FFT_MAXFFTSIZE];
  39. int Perm[FFT_MAXFFTSIZE];
  40. int factor[FFT_NFACTOR];
  41. } FFTstr;
  42. /* double precision routine */
  43. int WebRtcIsac_Fftns(unsigned int ndim,
  44. const int dims[],
  45. double Re[],
  46. double Im[],
  47. int isign,
  48. double scaling,
  49. FFTstr* fftstate);
  50. #endif /* MODULES_THIRD_PARTY_FFT_FFT_H_ */