annotate ext/kissfft/tools/kfc.h @ 409:1f1999b0f577

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