ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_biquad_f32_ansi.c File Reference
#include "dsps_biquad.h"
Include dependency graph for dsps_biquad_f32_ansi.c:

Go to the source code of this file.

Functions

esp_err_t dsps_biquad_f32_ansi (const float *input, float *output, int len, float *coef, float *w)
 IIR filter.

Function Documentation

◆ dsps_biquad_f32_ansi()

esp_err_t dsps_biquad_f32_ansi ( const float * input,
float * output,
int len,
float * coef,
float * w )

IIR filter.

IIR filter 2nd order direct form II (bi quad) The extension (_ansi) use ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.

Parameters
[in]inputinput array
outputoutput array
lenlength of input and output vectors
coefarray of coefficients. b0,b1,b2,a1,a2 expected that a0 = 1. b0..b2 - numerator, a0..a2 - denominator
wdelay line w0,w1. Length of 2.
Returns
  • ESP_OK on success
  • One of the error codes from DSP library

Definition at line 19 of file dsps_biquad_f32_ansi.c.

20{
21 for (int i = 0 ; i < len ; i++) {
22 float d0 = input[i] - coef[3] * w[0] - coef[4] * w[1];
23 output[i] = coef[0] * d0 + coef[1] * w[0] + coef[2] * w[1];
24 w[1] = w[0];
25 w[0] = d0;
26 }
27 return ESP_OK;
28}
#define ESP_OK
Definition esp_err.h:23

References ESP_OK.

Referenced by test_iir_biquad().

Here is the caller graph for this function: