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