|
ESP-IDF Firmware
Firmware architecture and call graph
|
#include "dsp_err.h"#include "sdkconfig.h"#include "dsps_fft_tables.h"#include "dsps_fft2r_platform.h"Go to the source code of this file.
Macros | |
| #define | CONFIG_DSP_MAX_FFT_SIZE 4096 |
| #define | dsps_fft2r_fc32_ae32(data, N) |
| #define | dsps_fft2r_fc32_aes3(data, N) |
| #define | dsps_fft2r_fc32_arp4(data, N) |
| #define | dsps_fft2r_sc16_ae32(data, N) |
| #define | dsps_fft2r_sc16_aes3(data, N) |
| #define | dsps_fft2r_sc16_arp4(data, N) |
| #define | dsps_fft2r_fc32_ansi(data, N) |
| #define | dsps_fft2r_sc16_ansi(data, N) |
| #define | dsps_fft2r_fc32 dsps_fft2r_fc32_ansi |
| #define | dsps_bit_rev_fc32 dsps_bit_rev_fc32_ansi |
| #define | dsps_cplx2reC_fc32 dsps_cplx2reC_fc32_ansi |
| #define | dsps_bit_rev_sc16 dsps_bit_rev_sc16_ansi |
| #define | dsps_bit_rev_lookup_fc32 dsps_bit_rev_lookup_fc32_ansi |
| #define | dsps_fft2r_sc16 dsps_fft2r_sc16_ansi |
Functions | |
| esp_err_t | dsps_bit_rev_lookup_fc32_ansi (float *data, int reverse_size, uint16_t *reverse_tab) |
| esp_err_t | dsps_bit_rev_lookup_fc32_ae32 (float *data, int reverse_size, uint16_t *reverse_tab) |
| esp_err_t | dsps_bit_rev_lookup_fc32_aes3 (float *data, int reverse_size, uint16_t *reverse_tab) |
| esp_err_t | dsps_cplx2real256_fc32_ansi (float *data) |
| esp_err_t | dsps_gen_bitrev2r_table (int N, int step, char *name_ext) |
| esp_err_t | dsps_fft2r_init_fc32 (float *fft_table_buff, int table_size) |
| init fft tables | |
| esp_err_t | dsps_fft2r_init_sc16 (int16_t *fft_table_buff, int table_size) |
| void | dsps_fft2r_deinit_fc32 (void) |
| deinit fft tables | |
| void | dsps_fft2r_deinit_sc16 (void) |
| esp_err_t | dsps_fft2r_fc32_ansi_ (float *data, int N, float *w) |
| complex FFT of radix 2 | |
| esp_err_t | dsps_fft2r_fc32_ae32_ (float *data, int N, float *w) |
| esp_err_t | dsps_fft2r_fc32_aes3_ (float *data, int N, float *w) |
| esp_err_t | dsps_fft2r_fc32_arp4_ (float *data, int N, float *w) |
| esp_err_t | dsps_fft2r_sc16_ansi_ (int16_t *data, int N, int16_t *w) |
| esp_err_t | dsps_fft2r_sc16_ae32_ (int16_t *data, int N, int16_t *w) |
| esp_err_t | dsps_fft2r_sc16_aes3_ (int16_t *data, int N, int16_t *w) |
| esp_err_t | dsps_fft2r_sc16_arp4_ (int16_t *data, int N, int16_t *w) |
| esp_err_t | dsps_bit_rev_fc32_ansi (float *data, int N) |
| bit reverse operation for the complex input array | |
| esp_err_t | dsps_bit_rev_sc16_ansi (int16_t *data, int N) |
| esp_err_t | dsps_bit_rev2r_fc32 (float *data, int N) |
| esp_err_t | dsps_gen_w_r2_fc32 (float *w, int N) |
| Generate coefficients table for the FFT radix 2. | |
| esp_err_t | dsps_gen_w_r2_sc16 (int16_t *w, int N) |
| esp_err_t | dsps_cplx2reC_fc32_ansi (float *data, int N) |
| Convert complex array to two real arrays. | |
| esp_err_t | dsps_cplx2reC_sc16 (int16_t *data, int N) |
| esp_err_t | dsps_cplx2real_sc16_ansi (int16_t *data, int N) |
| Convert complex FFT result to real array. | |
Variables | |
| float * | dsps_fft_w_table_fc32 |
| int | dsps_fft_w_table_size |
| uint8_t | dsps_fft2r_initialized |
| int16_t * | dsps_fft_w_table_sc16 |
| int | dsps_fft_w_table_sc16_size |
| uint8_t | dsps_fft2r_sc16_initialized |
| #define CONFIG_DSP_MAX_FFT_SIZE 4096 |
Definition at line 24 of file dsps_fft2r.h.
Referenced by dsps_fft2r_init_fc32(), dsps_fft2r_init_sc16(), dsps_fft4r_init_fc32(), dsps_sfdr_f32(), dsps_snr_f32(), microphone_read_task(), and microphone_read_task().
| #define dsps_bit_rev_fc32 dsps_bit_rev_fc32_ansi |
Definition at line 249 of file dsps_fft2r.h.
Referenced by dsps_bit_rev2r_fc32(), dsps_dct_f32(), dsps_dct_inv_f32(), dsps_dctiv_f32(), and dsps_dstiv_f32().
| #define dsps_bit_rev_lookup_fc32 dsps_bit_rev_lookup_fc32_ansi |
Definition at line 252 of file dsps_fft2r.h.
Referenced by dsps_bit_rev2r_fc32(), and dsps_bit_rev4r_fc32().
| #define dsps_bit_rev_sc16 dsps_bit_rev_sc16_ansi |
Definition at line 251 of file dsps_fft2r.h.
| #define dsps_cplx2reC_fc32 dsps_cplx2reC_fc32_ansi |
Definition at line 250 of file dsps_fft2r.h.
| #define dsps_fft2r_fc32 dsps_fft2r_fc32_ansi |
Definition at line 248 of file dsps_fft2r.h.
Referenced by dsps_dct_f32(), dsps_dct_inv_f32(), dsps_dctiv_f32(), dsps_dstiv_f32(), and test_fft2r().
Definition at line 107 of file dsps_fft2r.h.
Definition at line 108 of file dsps_fft2r.h.
Definition at line 114 of file dsps_fft2r.h.
Referenced by dsps_sfdr_f32(), and dsps_snr_f32().
Definition at line 109 of file dsps_fft2r.h.
| #define dsps_fft2r_sc16 dsps_fft2r_sc16_ansi |
Definition at line 253 of file dsps_fft2r.h.
Definition at line 111 of file dsps_fft2r.h.
Referenced by microphone_read_task(), and microphone_read_task().
Definition at line 112 of file dsps_fft2r.h.
Definition at line 115 of file dsps_fft2r.h.
Definition at line 113 of file dsps_fft2r.h.
| 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_ae32 | ( | float * | data, |
| int | reverse_size, | ||
| uint16_t * | reverse_tab ) |
References data.
| esp_err_t dsps_bit_rev_lookup_fc32_aes3 | ( | float * | data, |
| int | reverse_size, | ||
| uint16_t * | reverse_tab ) |
| esp_err_t dsps_bit_rev_lookup_fc32_ansi | ( | float * | data, |
| int | reverse_size, | ||
| uint16_t * | reverse_tab ) |
| esp_err_t dsps_bit_rev_sc16_ansi | ( | int16_t * | data, |
| int | N ) |
Definition at line 181 of file dsps_fft2r_sc16_ansi.c.
References data, dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, k, and N.
Referenced by dsps_fft2r_init_sc16(), microphone_read_task(), and microphone_read_task().
| esp_err_t dsps_cplx2real_sc16_ansi | ( | int16_t * | data, |
| int | N ) |
Convert complex FFT result to real array.
Convert FFT result of complex FFT for resl input to real array. 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 268 of file dsps_fft2r_sc16_ansi.c.
References data, dsp_power_of_two(), dsps_fft_w_table_sc16, ESP_OK, sc16_u::im, k, N, sc16_u::re, and reverse().
| 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.
| esp_err_t dsps_cplx2reC_sc16 | ( | int16_t * | data, |
| int | N ) |
Definition at line 227 of file dsps_fft2r_sc16_ansi.c.
References data, sc16_u::data, dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, sc16_u::im, N, and sc16_u::re.
Referenced by microphone_read_task(), and microphone_read_task().
| 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.
| void dsps_fft2r_deinit_sc16 | ( | void | ) |
Definition at line 108 of file dsps_fft2r_sc16_ansi.c.
References dsps_fft2r_sc16_initialized, dsps_fft2r_sc16_mem_allocated, and dsps_fft_w_table_sc16.
| esp_err_t dsps_fft2r_fc32_aes3_ | ( | float * | data, |
| int | N, | ||
| float * | w ) |
| 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_fft2r_init_sc16 | ( | int16_t * | fft_table_buff, |
| int | table_size ) |
Definition at line 70 of file dsps_fft2r_sc16_ansi.c.
References CONFIG_DSP_MAX_FFT_SIZE, dsps_bit_rev_sc16_ansi(), dsps_fft2r_sc16_initialized, dsps_fft2r_sc16_mem_allocated, dsps_fft_w_table_sc16, dsps_fft_w_table_sc16_size, dsps_gen_w_r2_sc16(), ESP_ERR_DSP_PARAM_OUTOFRANGE, ESP_ERR_DSP_REINITIALIZED, ESP_OK, and memalign.
Referenced by microphone_read_task(), and microphone_read_task().
| esp_err_t dsps_fft2r_sc16_ansi_ | ( | int16_t * | data, |
| int | N, | ||
| int16_t * | w ) |
Definition at line 117 of file dsps_fft2r_sc16_ansi.c.
References data, sc16_u::data, dsp_is_power_of_two(), dsps_fft2r_sc16_initialized, ESP_ERR_DSP_INVALID_LENGTH, ESP_ERR_DSP_UNINITIALIZED, ESP_OK, sc16_u::im, m, N, sc16_u::re, xtfixed_bf_1(), xtfixed_bf_2(), xtfixed_bf_3(), and xtfixed_bf_4().
| 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().
| esp_err_t dsps_gen_w_r2_sc16 | ( | int16_t * | w, |
| int | N ) |
Definition at line 208 of file dsps_fft2r_sc16_ansi.c.
References dsp_is_power_of_two(), ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, M_PI, and N.
Referenced by dsps_fft2r_init_sc16().
|
extern |
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().
|
extern |
Definition at line 26 of file dsps_fft2r_sc16_ansi.c.
Referenced by dsps_fft2r_deinit_sc16(), dsps_fft2r_init_sc16(), and dsps_fft2r_sc16_ansi_().
|
extern |
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().
|
extern |
Definition at line 24 of file dsps_fft2r_sc16_ansi.c.
Referenced by dsps_cplx2real_sc16_ansi(), dsps_fft2r_deinit_sc16(), and dsps_fft2r_init_sc16().
|
extern |
Definition at line 25 of file dsps_fft2r_sc16_ansi.c.
Referenced by dsps_fft2r_init_sc16().
|
extern |
Definition at line 28 of file dsps_fft2r_fc32_ansi.c.
Referenced by dsps_fft2r_init_fc32().