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_iir_biquad ()
int main (void)

Function Documentation

◆ main()

int main ( void )

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

5{
6 printf("main starts!\n");
7// xt_iss_profile_enable();
9// xt_iss_profile_disable();
10
11 printf("Test done\n");
12}
void test_iir_biquad()

References test_iir_biquad().

Here is the call graph for this function:

◆ test_iir_biquad()

void test_iir_biquad ( )

Definition at line 22 of file test_iir_biquad.c.

23{
24 float coeffs_lpf[5] = {0.073802, 0.147603, 0.073802, -1.250516, 0.545723};
25 float w_lpf[5] = {0, 0};
26 float w_lpf_ref[5] = {0, 0};
27 esp_err_t ret = ESP_OK;
28
29 for (size_t i = 0; i < N; i++) {
30 d[i] = 0;
31 }
32 d[0] = 1;
34 ret = dsps_biquad_f32_ansi(d, y_ref, N, coeffs_lpf, w_lpf_ref);
36 if (ret != ESP_OK) {
37 printf("dsps_biquad_f32 error = %i\n", ret);
38 return;
39 }
41 ret = dsps_biquad_f32_aes3(d, y, N, coeffs_lpf, w_lpf);
43 if (ret != ESP_OK) {
44 printf("dsps_biquad_f32 error = %i\n", ret);
45 return;
46 }
47 for (size_t i = 0; i < N; i++) {
48 if (((y[i] - y_ref[i]) > 0.0000001) || (y[i] - y_ref[i]) < -0.0000001) {
49 printf("ERROR result[%i]: %f, expect = %f, diff=%f\n", i, y[i], y_ref[i], y[i] - y_ref[i]);
50 return;
51
52 }
53 }
54 printf("Test Correct!\n");
55
56}
esp_err_t dsps_biquad_f32_ansi(const float *input, float *output, int len, float *coef, float *w)
IIR filter.
int esp_err_t
Definition esp_err.h:21
#define ESP_OK
Definition esp_err.h:23
float y[1024]
Definition test_fir.c:11
void xt_iss_profile_disable()
float d[1024]
float y_ref[1024]
esp_err_t dsps_biquad_f32_aes3(const float *input, float *output, int len, float *coef, float *w)
void xt_iss_profile_enable()
#define N
Definition test_mmult.c:13

References d, dsps_biquad_f32_aes3(), dsps_biquad_f32_ansi(), ESP_OK, N, xt_iss_profile_disable(), xt_iss_profile_enable(), y, and y_ref.

Referenced by main().

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