Mercurial > hg > qm-dsp
comparison 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 |
comparison
equal
deleted
inserted
replaced
408:5316fa4b0f33 | 409:1f1999b0f577 |
---|---|
1 #ifndef KFC_H | |
2 #define KFC_H | |
3 #include "kiss_fft.h" | |
4 | |
5 #ifdef __cplusplus | |
6 extern "C" { | |
7 #endif | |
8 | |
9 /* | |
10 KFC -- Kiss FFT Cache | |
11 | |
12 Not needing to deal with kiss_fft_alloc and a config | |
13 object may be handy for a lot of programs. | |
14 | |
15 KFC uses the underlying KISS FFT functions, but caches the config object. | |
16 The first time kfc_fft or kfc_ifft for a given FFT size, the cfg | |
17 object is created for it. All subsequent calls use the cached | |
18 configuration object. | |
19 | |
20 NOTE: | |
21 You should probably not use this if your program will be using a lot | |
22 of various sizes of FFTs. There is a linear search through the | |
23 cached objects. If you are only using one or two FFT sizes, this | |
24 will be negligible. Otherwise, you may want to use another method | |
25 of managing the cfg objects. | |
26 | |
27 There is no automated cleanup of the cached objects. This could lead | |
28 to large memory usage in a program that uses a lot of *DIFFERENT* | |
29 sized FFTs. If you want to force all cached cfg objects to be freed, | |
30 call kfc_cleanup. | |
31 | |
32 */ | |
33 | |
34 /*forward complex FFT */ | |
35 void kfc_fft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout); | |
36 /*reverse complex FFT */ | |
37 void kfc_ifft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout); | |
38 | |
39 /*free all cached objects*/ | |
40 void kfc_cleanup(void); | |
41 | |
42 #ifdef __cplusplus | |
43 } | |
44 #endif | |
45 | |
46 #endif |