HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_FFT.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_FFT.h
7  *
8  * COMMENTS:
9  *
10  * Performs a fast discrete fourier transform (or an inverse) on
11  * array data.
12  * FORWARD: Takes real data and produces complex data.
13  * INVERSE: Takes complex data and produces real data.
14  */
15 
16 #ifndef __UT_FFT__
17 #define __UT_FFT__
18 
19 #include "UT_API.h"
20 #include <SYS/SYS_Types.h>
21 
22 template <typename T>
24 {
25 public:
26  explicit UT_FFT(exint npnts);
27  ~UT_FFT();
28 
29  void toFrequency(T *source, T *destr, T *desti, exint npnts);
30  void toFrequency(T *sourcer, T *sourcei, T *destr, T *desti, exint npnts);
31  void toTime(T *sourcer, T *sourcei, T *dest, exint npnts);
32 
33  void toTime(T *sourcer, T *sourcei, T *destr, T *desti, exint npnts);
34 
35  // two dimensional FFT'ing
36  static void toFrequency2D(T *sourcer, T *sourcei, T *destr, T *desti,
37  exint size);
38  static void toTime2D(T *sourcer, T *sourcei, T *destr, T *desti, exint size);
39 
40 private:
41 
42  int for_fft(T *yre, T *yim, T *zre, T *zim, exint npts);
43  int inv_fft(T *yre, T *yim, T *zre, T *zim, exint npts);
44 
45  void dofft(int agamma);
46  void fftcopy(T *pr_from, T *pi_from, T *p_to, exint npts, int is_plus);
47 
48  void ifftcopy(T *p_from, T *pr_to, T *pi_to, int agamma, T factr, T facti);
49  void fftfill(T *p_co, exint part, exint all);
50 
51  void make_w(int neww);
52  void butterfly(int fly,int agamma);
53 
54  static void init_bitsw();
55  static int slow_bitsw(int k,int n);
56  static exint bitswitch(exint k, exint n);
57 
58  T *x_co;
59  T *w_co;
60 
61  static unsigned char tbl[256];
62  int gamma;
63  exint fft_size;
64 
65 };
66 
67 #endif
Definition: UT_FFT.h:23
#define UT_API
Definition: UT_API.h:12
GLsizeiptr size
Definition: glcorearb.h:663
GLdouble n
Definition: glcorearb.h:2007
int64 exint
Definition: SYS_Types.h:115
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802