|
ne10_fft_r2c_cfg_float32_t | ne10_fft_alloc_r2c_float32 (ne10_int32_t nfft) |
| User-callable function to allocate all necessary storage space for the fft (r2c/c2r). More...
|
|
void | ne10_fft_r2c_1d_float32_c (ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg) |
| Mixed radix-2/4 FFT (real to complex) of float(32-bit) data. More...
|
|
void | ne10_fft_c2r_1d_float32_c (ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg) |
| Mixed radix-2/4 IFFT (complex to real) of float(32-bit) data. More...
|
|
void | ne10_fft_r2c_1d_float32_neon (ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg) |
| Mixed radix-2/4 FFT (real to complex) of float(32-bit) data. More...
|
|
void | ne10_fft_c2r_1d_float32_neon (ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg) |
| Mixed radix-2/4 IFFT (complex to real) of float(32-bit) data. More...
|
|
ne10_fft_r2c_cfg_int16_t | ne10_fft_alloc_r2c_int16 (ne10_int32_t nfft) |
| User-callable function to allocate all necessary storage space for the fft (r2c/c2r). More...
|
|
void | ne10_fft_r2c_1d_int16_c (ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 FFT (real to complex) of int16 data. More...
|
|
void | ne10_fft_c2r_1d_int16_c (ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 IFFT (complex to real) of int16 data. More...
|
|
void | ne10_fft_r2c_1d_int16_neon (ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 FFT (real to complex) of int16 data. More...
|
|
void | ne10_fft_c2r_1d_int16_neon (ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 IFFT (complex to real) of int16 data. More...
|
|
ne10_fft_r2c_cfg_int32_t | ne10_fft_alloc_r2c_int32 (ne10_int32_t nfft) |
| User-callable function to allocate all necessary storage space for the fft (r2c/c2r). More...
|
|
void | ne10_fft_r2c_1d_int32_c (ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 FFT (real to complex) of int32 data. More...
|
|
void | ne10_fft_c2r_1d_int32_c (ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 IFFT (complex to real) of int32 data. More...
|
|
void | ne10_fft_r2c_1d_int32_neon (ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 FFT (real to complex) of int32 data. More...
|
|
void | ne10_fft_c2r_1d_int32_neon (ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag) |
| Mixed radix-2/4 IFFT (complex to real) of int32 data. More...
|
|
- In Ne10 library, there has been complex FFT. But in many practical applications, signals are often real only. So that we implement the real to complex FFT and complex to real IFFT based on complex FFT.
- Function list
- This set of functions implements r2c one-dimensional FFT/c2r IFFT with
2^N
(N>1) size. The function list is as follows:
- fft_r2c_1d_float32
- fft_c2r_1d_float32
- fft_r2c_1d_int32
- fft_c2r_1d_int32
- fft_r2c_1d_int16
- fft_c2r_1d_int16
- Note: The functions operate on out-of-place buffer which use different buffer for input and output. We need a temp buffer for internal usage. This buffer is allocated by the users and the size is (fftSize * sizeof (ne10_fft_cpx_float32_t)).
- The format of input and output:
- r2c FFT
Input:{real[0], real[1],real[2],.... real[fftSize-2], real[fftSize-1]}. The length of input is fftSize real data.
Output:{real[0], imag[0], real[1], imag[1], real[2], imag[2].... real[fftSize/2], imag[fftSize/2],}. The length of output should be fftSize complex data. For the reason that output[i] is the conjugate of output[fftSize-i], so that we give here output[0]~output[fftSize/2].
- c2r IFFT
Input:{real[0], imag[0], real[1], imag[1], real[2], imag[2].... real[fftSize-1], imag[fftSize-1],} The length of input is fftSize complex data.
Output:{real[0], real[1],real[2],.... real[fftSize-2], real[fftSize-1]}. The length of output is fftSize real data.
- Lengths supported by the transform:
- The r2c FFT is based on complex FFT, so that the FFT size supported is the length
2^N
(N is 2, 3, 4, 5, 6, ......).
- Usage:
- The basic usage of these functions is simple. We take float fft as an example and it looks like the code as follows.
#include "NE10.h"
...
{
fftSize = 2^N; //N is 2, 3, 4, 5, 6....
in = (ne10_float32_t*) NE10_MALLOC (fftSize * sizeof (ne10_float32_t));
out = (ne10_fft_cpx_float32_t*) NE10_MALLOC (fftSize * sizeof (ne10_fft_cpx_float32_t));
ne10_fft_r2c_cfg_float32_t cfg;
...
cfg = ne10_fft_alloc_r2c_float32 (fftSize);
...
//FFT
ne10_fft_r2c_1d_float32_c (out, in, cfg);
...
//IFFT
ne10_fft_c2r_1d_float32_c (in, out, cfg);
...
NE10_FREE (cfg);
NE10_FREE (in);
NE10_FREE (out);
}
Note:
- ne10_fft_r2c_cfg_float32_t cfg is the pointer which points to the buffer storing the twiddles and factors. It's generated in ne10_fft_alloc_r2c_float32(fftSize). If the fftSize is same, you needn't generate it again.
- cfg->twiddles
This is pointer to the twiddle factor table.
- cfg->super_twiddles
This is pointer to the twiddle factor which for spliting complex and real.
- cfg->factors
This is factors buffer: 0: stage number, 1: stride for the first stage, others: factors.
For example, 128 could be split into 4x32, 4x8, 4x2, 2x1. The stage is 4, the stride of first stage is 128/2 = 64
. So that the factor buffer is[4, 64, 4, 32, 4, 8, 4, 2, 2, 1]
- cfg->buffer
This is pointer to the temp buffer for FFT calculation. This buffer is allocated in init function and the size is (fftSize * sizeof (ne10_fft_cpx_float32_t)).
§ ne10_fft_alloc_r2c_float32()
User-callable function to allocate all necessary storage space for the fft (r2c/c2r).
- Parameters
-
- Returns
- st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.
Definition at line 1193 of file NE10_fft_float32.c.
§ ne10_fft_alloc_r2c_int16()
User-callable function to allocate all necessary storage space for the fft (r2c/c2r).
- Parameters
-
- Returns
- st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.
Definition at line 1140 of file NE10_fft_int16.c.
§ ne10_fft_alloc_r2c_int32()
User-callable function to allocate all necessary storage space for the fft (r2c/c2r).
- Parameters
-
- Returns
- st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.
Definition at line 1125 of file NE10_fft_int32.c.
§ ne10_fft_c2r_1d_float32_c()
Mixed radix-2/4 IFFT (complex to real) of float(32-bit) data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_float32.c
Definition at line 1305 of file NE10_fft_float32.c.
§ ne10_fft_c2r_1d_float32_neon()
Mixed radix-2/4 IFFT (complex to real) of float(32-bit) data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_float32.c
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_float32.c
Definition at line 798 of file NE10_fft_float32.neon.c.
§ ne10_fft_c2r_1d_int16_c()
Mixed radix-2/4 IFFT (complex to real) of int16 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int16.c
Definition at line 1255 of file NE10_fft_int16.c.
§ ne10_fft_c2r_1d_int16_neon()
Mixed radix-2/4 IFFT (complex to real) of int16 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int16.c
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | *twiddles | point to the twiddle buffer |
[in] | *super_twiddles | point to the twiddle buffer for data split |
[in] | *factors | point to factors buffer. 0: stage number, 1: stride for the first stage, others: radix and stage's fft length/radix |
[in] | nfft | length of FFT |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int16.c
Definition at line 868 of file NE10_fft_int16.neon.c.
§ ne10_fft_c2r_1d_int32_c()
Mixed radix-2/4 IFFT (complex to real) of int32 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int32.c
Definition at line 1241 of file NE10_fft_int32.c.
§ ne10_fft_c2r_1d_int32_neon()
Mixed radix-2/4 IFFT (complex to real) of int32 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (complex to real). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int32.c
Definition at line 1385 of file NE10_fft_int32.neon.c.
§ ne10_fft_r2c_1d_float32_c()
Mixed radix-2/4 FFT (real to complex) of float(32-bit) data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_float32.c
Definition at line 1285 of file NE10_fft_float32.c.
§ ne10_fft_r2c_1d_float32_neon()
Mixed radix-2/4 FFT (real to complex) of float(32-bit) data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_float32.c
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_float32.c
Definition at line 771 of file NE10_fft_float32.neon.c.
§ ne10_fft_r2c_1d_int16_c()
Mixed radix-2/4 FFT (real to complex) of int16 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int16.c
Definition at line 1233 of file NE10_fft_int16.c.
§ ne10_fft_r2c_1d_int16_neon()
Mixed radix-2/4 FFT (real to complex) of int16 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int16.c
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | *twiddles | point to the twiddle buffer |
[in] | *super_twiddles | point to the twiddle buffer for data split |
[in] | *factors | point to factors buffer. 0: stage number, 1: stride for the first stage, others: radix and stage's fft length/radix |
[in] | nfft | length of FFT |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int16.c
Definition at line 840 of file NE10_fft_int16.neon.c.
§ ne10_fft_r2c_1d_int32_c()
Mixed radix-2/4 FFT (real to complex) of int32 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int32.c
Definition at line 1219 of file NE10_fft_int32.c.
§ ne10_fft_r2c_1d_int32_neon()
Mixed radix-2/4 FFT (real to complex) of int32 data.
- Parameters
-
[out] | *fout | point to the output buffer |
[in] | *fin | point to the input buffer |
[in] | cfg | point to the config struct |
[in] | scaled_flag | scale flag, 0 unscaled, 1 scaled |
- Returns
- none. The function implements a mixed radix-2/4 FFT (real to complex). The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, we alloc a temp buffer(the size is same as input buffer) for storing intermedia. For the usage of this function, please check test/test_suite_fft_int32.c
Definition at line 1357 of file NE10_fft_int32.neon.c.