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