gsl_fft_complex.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* fft/gsl_fft_complex.h
  2. *
  3. * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GSL_FFT_COMPLEX_H__
  20. #define __GSL_FFT_COMPLEX_H__
  21. #include <stddef.h>
  22. #include "gsl_math.h"
  23. #include "gsl_complex.h"
  24. #include "gsl_fft.h"
  25. #undef __BEGIN_DECLS
  26. #undef __END_DECLS
  27. #ifdef __cplusplus
  28. # define __BEGIN_DECLS extern "C" {
  29. # define __END_DECLS }
  30. #else
  31. # define __BEGIN_DECLS /* empty */
  32. # define __END_DECLS /* empty */
  33. #endif
  34. __BEGIN_DECLS
  35. /* Power of 2 routines */
  36. int gsl_fft_complex_radix2_forward (gsl_complex_packed_array data,
  37. const size_t stride,
  38. const size_t n);
  39. int gsl_fft_complex_radix2_backward (gsl_complex_packed_array data,
  40. const size_t stride,
  41. const size_t n);
  42. int gsl_fft_complex_radix2_inverse (gsl_complex_packed_array data,
  43. const size_t stride,
  44. const size_t n);
  45. int gsl_fft_complex_radix2_transform (gsl_complex_packed_array data,
  46. const size_t stride,
  47. const size_t n,
  48. const gsl_fft_direction sign);
  49. int gsl_fft_complex_radix2_dif_forward (gsl_complex_packed_array data,
  50. const size_t stride,
  51. const size_t n);
  52. int gsl_fft_complex_radix2_dif_backward (gsl_complex_packed_array data,
  53. const size_t stride,
  54. const size_t n);
  55. int gsl_fft_complex_radix2_dif_inverse (gsl_complex_packed_array data,
  56. const size_t stride,
  57. const size_t n);
  58. int gsl_fft_complex_radix2_dif_transform (gsl_complex_packed_array data,
  59. const size_t stride,
  60. const size_t n,
  61. const gsl_fft_direction sign);
  62. /* Mixed Radix general-N routines */
  63. typedef struct
  64. {
  65. size_t n;
  66. size_t nf;
  67. size_t factor[64];
  68. gsl_complex *twiddle[64];
  69. gsl_complex *trig;
  70. }
  71. gsl_fft_complex_wavetable;
  72. typedef struct
  73. {
  74. size_t n;
  75. double *scratch;
  76. }
  77. gsl_fft_complex_workspace;
  78. gsl_fft_complex_wavetable *gsl_fft_complex_wavetable_alloc (size_t n);
  79. void gsl_fft_complex_wavetable_free (gsl_fft_complex_wavetable * wavetable);
  80. gsl_fft_complex_workspace *gsl_fft_complex_workspace_alloc (size_t n);
  81. void gsl_fft_complex_workspace_free (gsl_fft_complex_workspace * workspace);
  82. int gsl_fft_complex_memcpy (gsl_fft_complex_wavetable * dest,
  83. gsl_fft_complex_wavetable * src);
  84. int gsl_fft_complex_forward (gsl_complex_packed_array data,
  85. const size_t stride,
  86. const size_t n,
  87. const gsl_fft_complex_wavetable * wavetable,
  88. gsl_fft_complex_workspace * work);
  89. int gsl_fft_complex_backward (gsl_complex_packed_array data,
  90. const size_t stride,
  91. const size_t n,
  92. const gsl_fft_complex_wavetable * wavetable,
  93. gsl_fft_complex_workspace * work);
  94. int gsl_fft_complex_inverse (gsl_complex_packed_array data,
  95. const size_t stride,
  96. const size_t n,
  97. const gsl_fft_complex_wavetable * wavetable,
  98. gsl_fft_complex_workspace * work);
  99. int gsl_fft_complex_transform (gsl_complex_packed_array data,
  100. const size_t stride, const size_t n,
  101. const gsl_fft_complex_wavetable * wavetable,
  102. gsl_fft_complex_workspace * work,
  103. const gsl_fft_direction sign);
  104. __END_DECLS
  105. #endif /* __GSL_FFT_COMPLEX_H__ */