|
ESP-IDF Firmware
Firmware architecture and call graph
|
#include "dsps_fft2r.h"#include "dsp_common.h"#include "dsp_types.h"#include <math.h>#include "esp_attr.h"#include "esp_log.h"#include <string.h>#include <malloc.h>Go to the source code of this file.
Functions | |
| unsigned short | reverse (unsigned short x, unsigned short N, int order) |
| esp_err_t | dsps_fft2r_init_fc32 (float *fft_table_buff, int table_size) |
| init fft tables | |
| void | dsps_fft2r_deinit_fc32 () |
| deinit fft tables | |
| esp_err_t | dsps_fft2r_fc32_ansi_ (float *data, int N, float *w) |
| complex FFT of radix 2 | |
| esp_err_t | dsps_bit_rev_fc32_ansi (float *data, int N) |
| bit reverse operation for the complex input array | |
| esp_err_t | dsps_gen_w_r2_fc32 (float *w, int N) |
| Generate coefficients table for the FFT radix 2. | |
| esp_err_t | dsps_cplx2reC_fc32_ansi (float *data, int N) |
| Convert complex array to two real arrays. | |
| esp_err_t | dsps_gen_bitrev2r_table (int N, int step, char *name_ext) |
| esp_err_t | dsps_bit_rev2r_fc32 (float *data, int N) |
| esp_err_t | dsps_bit_rev_lookup_fc32_ansi (float *data, int reverse_size, uint16_t *reverse_tab) |
Variables | |
| static const char * | TAG = "fftr2_ansi" |
| float * | dsps_fft_w_table_fc32 |
| int | dsps_fft_w_table_size |
| uint8_t | dsps_fft2r_initialized = 0 |
| uint8_t | dsps_fft2r_mem_allocated = 0 |
| uint16_t * | dsps_fft2r_ram_rev_table = NULL |
| esp_err_t dsps_bit_rev2r_fc32 | ( | float * | data, |
| int | N ) |
Definition at line 303 of file dsps_fft2r_fc32_ansi.c.
References data, dsps_bit_rev_fc32, dsps_bit_rev_lookup_fc32, dsps_fft2r_rev_tables_fc32, dsps_fft2r_rev_tables_fc32_size, and N.
| esp_err_t dsps_bit_rev_fc32_ansi | ( | float * | data, |
| int | N ) |
bit reverse operation for the complex input array
Bit reverse operation for the complex input array The implementation use ANSI C and could be compiled and run on any platform
| [in,out] | data | input/ complex array. An elements located: Re[0], Im[0], ... Re[N-1], Im[N-1] result of FFT will be stored to this array. |
| [in] | N | Number of complex elements in input array |
Definition at line 172 of file dsps_fft2r_fc32_ansi.c.
References data, dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, k, and N.
Referenced by dsps_fft2r_init_fc32(), dsps_sfdr_f32(), and dsps_snr_f32().
| esp_err_t dsps_bit_rev_lookup_fc32_ansi | ( | float * | data, |
| int | reverse_size, | ||
| uint16_t * | reverse_tab ) |
| esp_err_t dsps_cplx2reC_fc32_ansi | ( | float * | data, |
| int | N ) |
Convert complex array to two real arrays.
Convert complex array to two real arrays in case if input was two real arrays. This function have to be used if FFT used to process real data. The implementation use ANSI C and could be compiled and run on any platform
| [in,out] | data | Input complex array and result of FFT2R. input has size of 2*N, because contains real and imaginary part. result will be stored to the same array. Input1: input[0..N-1], Input2: input[N..2*N-1] |
| [in] | N | Number of complex elements in input array |
Definition at line 221 of file dsps_fft2r_fc32_ansi.c.
References data, dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, and N.
| void dsps_fft2r_deinit_fc32 | ( | void | ) |
deinit fft tables
Free resources of Complex FFT. This function delete coefficients table if it was allocated by dsps_fft2r_init_fc32. The implementation use ANSI C and could be compiled and run on any platform
Definition at line 102 of file dsps_fft2r_fc32_ansi.c.
References dsps_fft2r_initialized, dsps_fft2r_mem_allocated, dsps_fft2r_ram_rev_table, dsps_fft2r_rev_tables_init_fc32(), and dsps_fft_w_table_fc32.
| esp_err_t dsps_fft2r_fc32_ansi_ | ( | float * | data, |
| int | N, | ||
| float * | w ) |
complex FFT of radix 2
Complex FFT of radix 2 The extension (_ansi) use ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.
| [in,out] | data | input/output complex array. An elements located: Re[0], Im[0], ... Re[N-1], Im[N-1] result of FFT will be stored to this array. |
| [in] | N | Number of complex elements in input array |
| [in] | w | pointer to the sin/cos table |
Definition at line 123 of file dsps_fft2r_fc32_ansi.c.
References data, dsp_is_power_of_two(), dsps_fft2r_initialized, ESP_ERR_DSP_INVALID_LENGTH, ESP_ERR_DSP_UNINITIALIZED, ESP_OK, m, and N.
| esp_err_t dsps_fft2r_init_fc32 | ( | float * | fft_table_buff, |
| int | table_size ) |
init fft tables
Initialization of Complex FFT. This function initialize coefficients table. The implementation use ANSI C and could be compiled and run on any platform
| [in,out] | fft_table_buff | pointer to floating point buffer where sin/cos table will be stored if this parameter set to NULL, and table_size value is more then 0, then dsps_fft2r_init_fc32 will allocate buffer internally |
| [in] | table_size | size of the buffer in float words if fft_table_buff is NULL and table_size is not 0, buffer will be allocated internally. If table_size is 0, buffer will not be allocated. |
Definition at line 40 of file dsps_fft2r_fc32_ansi.c.
References CONFIG_DSP_MAX_FFT_SIZE, dsp_power_of_two(), dsps_bit_rev_fc32_ansi(), dsps_fft2r_initialized, dsps_fft2r_mem_allocated, dsps_fft2r_ram_rev_table, dsps_fft2r_rev_tables_fc32, dsps_fft2r_rev_tables_fc32_size, dsps_fft_w_table_fc32, dsps_fft_w_table_size, dsps_gen_w_r2_fc32(), ESP_ERR_DSP_PARAM_OUTOFRANGE, ESP_ERR_DSP_REINITIALIZED, ESP_OK, and memalign.
Referenced by dsps_sfdr_f32(), dsps_snr_f32(), and test_fft2r().
| esp_err_t dsps_gen_bitrev2r_table | ( | int | N, |
| int | step, | ||
| char * | name_ext ) |
Definition at line 270 of file dsps_fft2r_fc32_ansi.c.
References dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_LOGD, ESP_OK, k, N, and TAG.
| esp_err_t dsps_gen_w_r2_fc32 | ( | float * | w, |
| int | N ) |
Generate coefficients table for the FFT radix 2.
Generate coefficients table for the FFT radix 2. This function called inside init. The implementation use ANSI C and could be compiled and run on any platform
| [in,out] | w | memory location to store coefficients. By default coefficients will be stored to the dsps_fft_w_table_fc32. Maximum size of the FFT must be setup in menuconfig |
| [in] | N | maximum size of the FFT that will be used |
Definition at line 202 of file dsps_fft2r_fc32_ansi.c.
References dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, M_PI, and N.
Referenced by dsps_fft2r_init_fc32().
| unsigned short reverse | ( | unsigned short | x, |
| unsigned short | N, | ||
| int | order ) |
Definition at line 161 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_cplx2real_sc16_ansi().
| uint8_t dsps_fft2r_initialized = 0 |
Definition at line 29 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_dct_f32(), dsps_dct_inv_f32(), dsps_dctiv_f32(), dsps_dstiv_f32(), dsps_fft2r_deinit_fc32(), dsps_fft2r_fc32_ansi_(), and dsps_fft2r_init_fc32().
| uint8_t dsps_fft2r_mem_allocated = 0 |
Definition at line 30 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_fft2r_deinit_fc32(), and dsps_fft2r_init_fc32().
| uint16_t* dsps_fft2r_ram_rev_table = NULL |
Definition at line 32 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_fft2r_deinit_fc32(), and dsps_fft2r_init_fc32().
| float* dsps_fft_w_table_fc32 |
Definition at line 27 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_dct_f32(), dsps_fft2r_deinit_fc32(), dsps_fft2r_init_fc32(), and test_fft2r().
| int dsps_fft_w_table_size |
Definition at line 28 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_fft2r_init_fc32().
|
static |
Definition at line 25 of file dsps_fft2r_fc32_ansi.c.