www.pudn.com > FFTdemo.zip > fft.h
#ifndef __FFT_H__
#define __FFT_H__
/**
* Pi for fft, float type.
*/
#define PI 3.14159265358979323846
/* Complex type.
*/
typedef struct {
float rex, imx;
} Complex;
/**
* Decimation-in-Time Complex FFT Algorithm with Radix-2.
* Note:
* L : exponent value of 2, N = 2^L.
* cin : input complex array.
* cout: output complex array.
*/
void cfftr2( const int L,
const Complex *cin, Complex *cout);
/**
* in reverse FFT.
*/
void cifftr2(const int L,
const Complex *cin, Complex *cout);
/**
* DFT Algorithm, with arbitrary N point.
* Note: slow but sample, useful in verify other FFT algorithm.
*/
void dft(const int N,
const Complex cin[], Complex cout[]);
/**
* Bit reverse sort, use reverse addition.
*/
void revsort(const int N,
const Complex cin[], Complex cout[]);
/**
* Calculate the module and Normalize by LEVER.
*/
void module(const Complex cin[],
float pout[], const int N, const int LEVER);
#endif //__FFT_H__