ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
test_fir.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "dsp_common.h"
#include "dsps_fir.h"
Include dependency graph for test_fir.c:

Go to the source code of this file.

Functions

void test_fir ()

Variables

float x [1024]
float y [1024]
float y_compare [1024]
float coeffs [256]
float delay [256]
float delay_compare [256]

Function Documentation

◆ 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:

Variable Documentation

◆ coeffs

◆ delay

◆ delay_compare

float delay_compare[256]

Definition at line 16 of file test_fir.c.

Referenced by test_fir().

◆ x

◆ y

◆ y_compare

float y_compare[1024]

Definition at line 12 of file test_fir.c.

Referenced by test_fir().