Chris@184: #ifndef KFC_H Chris@184: #define KFC_H Chris@184: #include "kiss_fft.h" Chris@184: Chris@184: #ifdef __cplusplus Chris@184: extern "C" { Chris@184: #endif Chris@184: Chris@184: /* Chris@184: KFC -- Kiss FFT Cache Chris@184: Chris@184: Not needing to deal with kiss_fft_alloc and a config Chris@184: object may be handy for a lot of programs. Chris@184: Chris@184: KFC uses the underlying KISS FFT functions, but caches the config object. Chris@184: The first time kfc_fft or kfc_ifft for a given FFT size, the cfg Chris@184: object is created for it. All subsequent calls use the cached Chris@184: configuration object. Chris@184: Chris@184: NOTE: Chris@184: You should probably not use this if your program will be using a lot Chris@184: of various sizes of FFTs. There is a linear search through the Chris@184: cached objects. If you are only using one or two FFT sizes, this Chris@184: will be negligible. Otherwise, you may want to use another method Chris@184: of managing the cfg objects. Chris@184: Chris@184: There is no automated cleanup of the cached objects. This could lead Chris@184: to large memory usage in a program that uses a lot of *DIFFERENT* Chris@184: sized FFTs. If you want to force all cached cfg objects to be freed, Chris@184: call kfc_cleanup. Chris@184: Chris@184: */ Chris@184: Chris@184: /*forward complex FFT */ Chris@184: void kfc_fft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout); Chris@184: /*reverse complex FFT */ Chris@184: void kfc_ifft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout); Chris@184: Chris@184: /*free all cached objects*/ Chris@184: void kfc_cleanup(void); Chris@184: Chris@184: #ifdef __cplusplus Chris@184: } Chris@184: #endif Chris@184: Chris@184: #endif