-
Notifications
You must be signed in to change notification settings - Fork 0
/
spectrum_fft_CF.h
73 lines (54 loc) · 2.18 KB
/
spectrum_fft_CF.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "base.h"
#ifdef __cplusplus
namespace fastdsp{
namespace spectrum{
#endif
//! Complex FFT structure
typedef struct {
cfloat *InPtr; //!< Pointer to the input buffer
cfloat *OutPtr; //!< Pointer to the output buffer
float *CoefPtr; //!< Pointer to the twiddle factors
cfloat *CurrentInPtr; //!< Points to input buffer at each FFT stage
cfloat *CurrentOutPtr; //!< Points to output buffer at each FFT stage
count_t Stages; //!< Number of FFT stages
count_t FFTSize; //!< Size of the FFT (number of complex data points)
}fft_cf_t;
/*! \brief Generate twiddle factors for the Complex FFT
* \param cfft Pointer to the CFFT_F32 object
* \attention This function is written in C and compiled without optimization turned on.
*/
EXTERN int fft_init_CF(
fft_cf_t * cfft,
float32 *twiddles,
count_t stages
);
//! \brief Complex Fast Fourier Transform (Unaligned).
//!
//! This routine computes the 32-bit floating-point FFT for an N-pt (\f$ N = 2^{n}, n = 5 : 10\f$)
//! complex input. This function will reorder the input in bit-reversed format before proceeding with
//! the FFT. The routine uses two buffers in ping-pong fashion i.e. after each FFT stage the output and
//! input buffers become the input and output buffers respectively for the next stage. The CFFT_F32 object
//! uses two pointers, CurrentInPtr and CurrentOutPtr to keep track of the switching. The user can determine
//! the address of the final output by looking at the CurrentOutPtr.
//! \param cfft Pointer to the CFFT_F32 object
//! \attention
//! -# The routine requires the use of two buffers, each of size 2N (32-bit), for computation; the input
//! buffer need not be aligned to any boundary.
//! -# If alignment is possible the user can use the faster routine, CFFT_f32
//! \warning This function is not re-entrant as it uses global variables to store certain parameters
EXTERN cfloat *fft_transform_CF(
fft_cf_t *cfft,
cfloat *in_buffer,
cfloat *aux_buffer
);
//! Inverse transform
EXTERN cfloat *fft_itransform_CF(
fft_cf_t *cfft,
cfloat *in_buffer,
cfloat *aux_buffer
);
#ifdef __cplusplus
};
};
#endif