Mercurial > hg > qm-dsp
annotate ext/kissfft/tools/kfc.h @ 206:335be766a54d
Fix erroneous header guard
author | Chris Cannam |
---|---|
date | Fri, 30 Sep 2016 19:04:06 +0100 |
parents | 76ec2365b250 |
children |
rev | line source |
---|---|
Chris@184 | 1 #ifndef KFC_H |
Chris@184 | 2 #define KFC_H |
Chris@184 | 3 #include "kiss_fft.h" |
Chris@184 | 4 |
Chris@184 | 5 #ifdef __cplusplus |
Chris@184 | 6 extern "C" { |
Chris@184 | 7 #endif |
Chris@184 | 8 |
Chris@184 | 9 /* |
Chris@184 | 10 KFC -- Kiss FFT Cache |
Chris@184 | 11 |
Chris@184 | 12 Not needing to deal with kiss_fft_alloc and a config |
Chris@184 | 13 object may be handy for a lot of programs. |
Chris@184 | 14 |
Chris@184 | 15 KFC uses the underlying KISS FFT functions, but caches the config object. |
Chris@184 | 16 The first time kfc_fft or kfc_ifft for a given FFT size, the cfg |
Chris@184 | 17 object is created for it. All subsequent calls use the cached |
Chris@184 | 18 configuration object. |
Chris@184 | 19 |
Chris@184 | 20 NOTE: |
Chris@184 | 21 You should probably not use this if your program will be using a lot |
Chris@184 | 22 of various sizes of FFTs. There is a linear search through the |
Chris@184 | 23 cached objects. If you are only using one or two FFT sizes, this |
Chris@184 | 24 will be negligible. Otherwise, you may want to use another method |
Chris@184 | 25 of managing the cfg objects. |
Chris@184 | 26 |
Chris@184 | 27 There is no automated cleanup of the cached objects. This could lead |
Chris@184 | 28 to large memory usage in a program that uses a lot of *DIFFERENT* |
Chris@184 | 29 sized FFTs. If you want to force all cached cfg objects to be freed, |
Chris@184 | 30 call kfc_cleanup. |
Chris@184 | 31 |
Chris@184 | 32 */ |
Chris@184 | 33 |
Chris@184 | 34 /*forward complex FFT */ |
Chris@184 | 35 void kfc_fft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout); |
Chris@184 | 36 /*reverse complex FFT */ |
Chris@184 | 37 void kfc_ifft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout); |
Chris@184 | 38 |
Chris@184 | 39 /*free all cached objects*/ |
Chris@184 | 40 void kfc_cleanup(void); |
Chris@184 | 41 |
Chris@184 | 42 #ifdef __cplusplus |
Chris@184 | 43 } |
Chris@184 | 44 #endif |
Chris@184 | 45 |
Chris@184 | 46 #endif |