17 -- a utility that will handle the caching of fft objects
18 -- real-only (no imaginary time component ) FFT
19 -- a multi-dimensional FFT
20 -- a command-line utility to perform ffts
21 -- a command-line utility to perform fast-convolution filtering
23 Then see kfc.h kiss_fftr.h kiss_fftnd.h fftutil.c kiss_fastfir.c
24 in the tools/ directory.
27 #define KISS_FFT_S16_MALLOC g_malloc
31 #define kiss_fft_s16_scalar int16_t
34 kiss_fft_s16_scalar r;
35 kiss_fft_s16_scalar i;
38 typedef struct kiss_fft_s16_state* kiss_fft_s16_cfg;
43 * Initialize a FFT (or IFFT) algorithm's cfg/state buffer.
45 * typical usage: kiss_fft_s16_cfg mycfg=kiss_fft_s16_alloc(1024,0,NULL,NULL);
47 * The return value from fft_alloc is a cfg buffer used internally
48 * by the fft routine or NULL.
50 * If lenmem is NULL, then kiss_fft_s16_alloc will allocate a cfg buffer using malloc.
51 * The returned value should be free()d when done to avoid memory leaks.
53 * The state can be placed in a user supplied buffer 'mem':
54 * If lenmem is not NULL and mem is not NULL and *lenmem is large enough,
55 * then the function places the cfg in mem and the size used in *lenmem
58 * If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough),
59 * then the function returns NULL and places the minimum cfg
60 * buffer size in *lenmem.
63 kiss_fft_s16_cfg kiss_fft_s16_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem);
66 * kiss_fft(cfg,in_out_buf)
68 * Perform an FFT on a complex input buffer.
70 * fin should be f[0] , f[1] , ... ,f[nfft-1]
71 * fout will be F[0] , F[1] , ... ,F[nfft-1]
72 * Note that each element is complex and can be accessed like
75 void kiss_fft_s16(kiss_fft_s16_cfg cfg,const kiss_fft_s16_cpx *fin,kiss_fft_s16_cpx *fout);
78 A more generic version of the above function. It reads its input from every Nth sample.
80 void kiss_fft_s16_stride(kiss_fft_s16_cfg cfg,const kiss_fft_s16_cpx *fin,kiss_fft_s16_cpx *fout,int fin_stride);
82 /* If kiss_fft_s16_alloc allocated a buffer, it is one contiguous
83 buffer and can be simply free()d when no longer needed*/
84 #define kiss_fft_s16_free g_free
87 Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up
88 your compiler output to call this before you exit.
90 void kiss_fft_s16_cleanup(void);
94 * Returns the smallest integer k, such that k>=n and k has only "fast" factors (2,3,5)
96 int kiss_fft_s16_next_fast_size(int n);
98 /* for real ffts, we need an even size */
99 #define kiss_fftr_next_fast_size_real(n) \
100 (kiss_fft_next_fast_size( ((n)+1)>>1)<<1)