ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
main.c File Reference
#include <stdlib.h>
#include <stdio.h>
Include dependency graph for components/espressif__esp-dsp/modules/fft/test_sim/main.c:

Go to the source code of this file.

Functions

void test_fft2r ()
int main (void)

Function Documentation

◆ main()

int main ( void )

Definition at line 6 of file components/espressif__esp-dsp/modules/fft/test_sim/main.c.

7{
8 printf("main starts!\n");
9// xt_iss_profile_enable();
10 test_fft2r();
11// xt_iss_profile_disable();
12
13 printf("Test done\n");
14}
void test_fft2r()
Definition test_fft2r.c:38

References test_fft2r().

Here is the call graph for this function:

◆ test_fft2r()

void test_fft2r ( )

Definition at line 38 of file test_fft2r.c.

39{
40
41 int N = sizeof(data) / sizeof(float) / 2;
42 int check_bin = 32;
43 float check_ampl = 2000;
44 for (int i = 0 ; i < N ; i++) {
45 data[i * 2 + 0] = check_ampl * sinf(M_PI / N * check_bin * 2 * i) / (N / 2);
46 data[i * 2 + 1] = 2;
47 }
48 for (int i = 0 ; i < N * 2 ; i++) {
49 check_data[i] = data[i];
50 data_test[i] = -1;
51 }
52
53 // Init FFT tables
54 esp_err_t ret = dsps_fft2r_init_fc32(NULL, 4096);
55 TEST_ESP_OK(ret);
56 int N_check = N;
57 // table = (uint16_t *)dsps_fft2r_rev_tables_fc32[6];
58 // table_size = dsps_fft2r_rev_tables_fc32_size[6];
59
61 dsps_fft2r_fc32(data, N_check);
62// dsps_bit_rev_lookup_fc32_ae32(data, N_check, dsps_fft2r_rev_tables_fc32[6]);
64// dsps_bit_rev_lookup_fc32_ae32(data, N_check, dsps_fft2r_rev_tables_fc32[6]);
66
67 for (int i = 0 ; i < N_check ; i++) {
68 if (abs(check_data[i] - data[i]) == 0) {
69 printf("Data[%i] =%8.4f, %8.4f, %f \n", i, data[i], check_data[i], check_data[i] - data[i]);
70 } else {
71 printf("ERROR: Data[%i] =%f, %f, %f \n", i, data[i], check_data[i], check_data[i] - data[i]);
72 }
73 }
74
75
76 printf("Test Pass!\n");
77}
esp_err_t dsps_fft2r_fc32_aes3_(float *data, int N, float *w)
#define dsps_fft2r_fc32
Definition dsps_fft2r.h:248
float * dsps_fft_w_table_fc32
esp_err_t dsps_fft2r_init_fc32(float *fft_table_buff, int table_size)
init fft tables
int esp_err_t
Definition esp_err.h:21
#define M_PI
Definition esp_err.h:26
void xt_iss_profile_disable()
static float data[128 *2]
Definition test_fft2r.c:34
static float data_test[128 *2]
Definition test_fft2r.c:36
static float check_data[128 *2]
Definition test_fft2r.c:35
void xt_iss_profile_enable()
#define N
Definition test_mmult.c:13

References check_data, data, data_test, dsps_fft2r_fc32, dsps_fft2r_fc32_aes3_(), dsps_fft2r_init_fc32(), dsps_fft_w_table_fc32, M_PI, N, xt_iss_profile_disable(), and xt_iss_profile_enable().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: