0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
1 #ifndef PECK_FFTR_H
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
2 #define PECK_FFTR_H
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
3
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
4 #include "peck_fft.h"
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
5
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
6 #ifdef __cplusplus
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
7 extern "C" {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
8 #endif
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
9
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
10 /*
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
11 * Real optimized version can save about 45% cpu time vs. complex fft of a real seq.
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
12 */
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
13 typedef struct peck_fftr_state *peck_fftr_cfg;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
14
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
15 /*
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
16 * peck_fftr_alloc()
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
17 * nfft must be even
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
18 *
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
19 * If you don't care to allocate space, use mem = lenmem = NULL.
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
20 */
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
21 peck_fftr_cfg peck_fftr_alloc(int nfft, int inverse_fft, void * mem, size_t * lenmem);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
22
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
23 /*
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
24 * peck_fftr()
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
25 * input timedata has nfft scalar points
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
26 * output freqdata has nfft/2+1 complex points
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
27 */
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
28 void peck_fftr(peck_fftr_cfg cfg,const peck_fft_scalar *timedata, peck_fft_cpx *freqdata);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
29
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
30 /*
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
31 * peck_fftri()
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
32 * input freqdata has nfft/2+1 complex points
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
33 * output timedata has nfft scalar points
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
34 */
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
35 void peck_fftri(peck_fftr_cfg cfg,const peck_fft_cpx *freqdata, peck_fft_scalar *timedata);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
36
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
37 #define peck_fftr_free free
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
38
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
39 #ifdef __cplusplus
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
40 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
41 #endif
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
42
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
43 #endif /* PECK_FFTR_H */
|