26 #ifndef GRT_FAST_FOURIER_TRANSFORM_HEADER 27 #define GRT_FAST_FOURIER_TRANSFORM_HEADER 29 #include "../../Util/GRTCommon.h" 30 #include "../../CoreModules/GRTBase.h" 38 enum WindowFunctionOptions{RECTANGULAR_WINDOW=0,BARTLETT_WINDOW,HAMMING_WINDOW,HANNING_WINDOW};
48 bool init(
const unsigned int windowSize,
const unsigned int windowFunction = RECTANGULAR_WINDOW,
const bool computeMagnitude =
true,
const bool computePhase =
true,
bool enableZeroPadding =
true);
55 Float getAveragePower()
const;
56 Float *getMagnitudeDataPtr();
57 Float *getPhaseDataPtr();
58 Float *getPowerDataPtr();
60 UINT getFFTSize()
const {
return windowSize; }
64 bool realFFT(
const VectorFloat &realIn, Float *realOut, Float *imagOut );
65 bool FFT(
int NumSamples,
bool InverseTransform,Float *realIn, Float *imagIn, Float *realOut, Float *imagOut);
66 int numberOfBitsNeeded(
int PowerOfTwo);
67 int reverseBits(
int index,
int NumBits);
69 inline int fastReverseBits(
const int i,
const int NumBits);
70 inline bool isPowerOfTwo(
const unsigned int x);
72 unsigned int windowSize;
73 unsigned int windowFunction;
75 bool computeMagnitude;
77 bool enableZeroPadding;
86 const static int MAX_FAST_BITS = 16;
92 #endif //GRT_FAST_FOURIER_TRANSFORM_HEADER