forked from mborgerding/kissfft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kfc.h
54 lines (42 loc) · 1.5 KB
/
kfc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright (c) 2003-2004, Mark Borgerding. All rights reserved.
* This file is part of KISS FFT - https://github.com/mborgerding/kissfft
*
* SPDX-License-Identifier: BSD-3-Clause
* See COPYING file for more information.
*/
#ifndef KFC_H
#define KFC_H
#include "kiss_fft.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
KFC -- Kiss FFT Cache
Not needing to deal with kiss_fft_alloc and a config
object may be handy for a lot of programs.
KFC uses the underlying KISS FFT functions, but caches the config object.
The first time kfc_fft or kfc_ifft for a given FFT size, the cfg
object is created for it. All subsequent calls use the cached
configuration object.
NOTE:
You should probably not use this if your program will be using a lot
of various sizes of FFTs. There is a linear search through the
cached objects. If you are only using one or two FFT sizes, this
will be negligible. Otherwise, you may want to use another method
of managing the cfg objects.
There is no automated cleanup of the cached objects. This could lead
to large memory usage in a program that uses a lot of *DIFFERENT*
sized FFTs. If you want to force all cached cfg objects to be freed,
call kfc_cleanup.
*/
/*forward complex FFT */
void KISS_FFT_API kfc_fft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout);
/*reverse complex FFT */
void KISS_FFT_API kfc_ifft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout);
/*free all cached objects*/
void KISS_FFT_API kfc_cleanup(void);
#ifdef __cplusplus
}
#endif
#endif