00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __UT_FFT__
00025 #define __UT_FFT__
00026
00027 #include "UT_API.h"
00028 #include <SYS/SYS_Types.h>
00029
00030 class UT_API UT_FFT
00031 {
00032 public:
00033 explicit UT_FFT(long npnts);
00034 ~UT_FFT();
00035
00036 void toFrequency(float *source,float *destr,float *desti,long npnts);
00037 void toFrequency(float *sourcer, float *sourcei,float *destr,float *desti,long npnts);
00038 void toTime(float *sourcer,float *sourcei,float *dest,long npnts);
00039
00040 void toTime(float *sourcer,float *sourcei,float *destr,float *desti,long npnts);
00041
00042
00043 static void toFrequency2D(float *sourcer, float *sourcei, float *destr,float *desti,long size);
00044 static void toTime2D(float *sourcer, float *sourcei, float *destr,float *desti,long size);
00045
00046 private:
00047
00048 int for_fft(float *yre, float *yim,float *zre,float *zim,int npts);
00049 int inv_fft(float *yre, float *yim,float *zre,float *zim,int npts);
00050
00051 void dofft(int agamma);
00052 void fftcopy(float *pr_from, float *pi_from,float *p_to,
00053 int npts,int is_plus);
00054
00055 void ifftcopy(float *p_from, float *pr_to,float *pi_to,
00056 int agamma,fpreal factr,fpreal facti);
00057 void fftfill(float *p_co,int part,int all);
00058
00059 void make_w(int neww);
00060 void butterfly(int fly,int agamma);
00061
00062 static void init_bitsw();
00063 static int slow_bitsw(int k,int n);
00064 static int bitswitch(int k,int n);
00065
00066 float *x_co;
00067 float *w_co;
00068
00069 static unsigned char tbl[256];
00070 int gamma,fft_size;
00071
00072 };
00073
00074 #endif