ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
main.c File Reference

Go to the source code of this file.

Functions

void test_fir ()
int main (void)

Function Documentation

◆ main()

int main ( void )

Definition at line 4 of file components/espressif__esp-dsp/modules/fir/test_sim/main.c.

5{
6 printf("main starts!\n");
7// xt_iss_profile_enable();
8 test_fir();
9// xt_iss_profile_disable();
10
11 printf("Test done\n");
12}
void test_fir()
Definition test_fir.c:19

References test_fir().

Here is the call graph for this function:

◆ test_fir()

void test_fir ( )

Definition at line 19 of file test_fir.c.

20{
21 int len = sizeof(x) / sizeof(float);
22 int fir_len = sizeof(coeffs) / sizeof(float);
23
24 fir_f32_t fir1;
25 fir_f32_t fir2;
26 for (int i = 0 ; i < fir_len ; i++) {
27 coeffs[i] = i;
28 }
29
30 for (int i = 0 ; i < len ; i++) {
31 x[i] = 0;
32 }
33 x[0] = 1;
34
35 for (int i = 0 ; i < fir_len ; i++) {
36 coeffs[i] = i;
37 }
38
39 for (int i = 0 ; i < len ; i++) {
40 x[i] = i;
41 }
42 x[0] = 1;
43 dsps_fir_init_f32(&fir1, coeffs, delay, fir_len / 4);
44 dsps_fir_init_f32(&fir2, coeffs, delay_compare, fir_len);
45
47 dsps_fir_f32_aes3(&fir1, x, y, len);
48 dsps_fir_f32_ansi(&fir2, x, y_compare, len);
50
51 printf("Test Pass!\n");
52}
struct fir_f32_s fir_f32_t
Data struct of f32 fir filter.
esp_err_t dsps_fir_f32_aes3(fir_f32_t *fir, const float *input, float *output, int len)
esp_err_t dsps_fir_f32_ansi(fir_f32_t *fir, const float *input, float *output, int len)
32 bit floating point FIR filter
esp_err_t dsps_fir_init_f32(fir_f32_t *fir, float *coeffs, float *delay, int coeffs_len)
initialize structure for 32 bit FIR filter
void xt_iss_profile_disable()
void xt_iss_profile_enable()
float y_compare[1024]
Definition test_fir.c:12
float y[1024]
Definition test_fir.c:11
float x[1024]
Definition test_fir.c:10
float delay[256]
Definition test_fir.c:15
float coeffs[256]
Definition test_fir.c:14
float delay_compare[256]
Definition test_fir.c:16

References coeffs, delay, delay_compare, dsps_fir_f32_aes3(), dsps_fir_f32_ansi(), dsps_fir_init_f32(), x, xt_iss_profile_disable(), xt_iss_profile_enable(), y, and y_compare.

Referenced by main().

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