ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_d_gen.h File Reference
#include "dsp_err.h"
Include dependency graph for dsps_d_gen.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

esp_err_t dsps_d_gen_f32 (float *output, int len, int pos)
 delta function

Function Documentation

◆ dsps_d_gen_f32()

esp_err_t dsps_d_gen_f32 ( float * output,
int len,
int pos )

delta function

The function generate delta function. output[i]=0, if i=[0..N) output[i]=1, if i=pos, pos: [0..N-1) The implementation use ANSI C and could be compiled and run on any platform

Parameters
outputoutput array.
lenlength of the input signal
posdelta function position
Returns
  • ESP_OK on success
  • One of the error codes from DSP library

Definition at line 17 of file dsps_d_gen.c.

18{
19 if (pos >= len) {
21 }
22 if (pos < 0) {
24 }
25 for (int i = 0 ; i < len ; i++) {
26 output[i] = 0;
27 }
28 output[pos] = 1;
29 return ESP_OK;
30}
#define ESP_ERR_DSP_PARAM_OUTOFRANGE
#define ESP_OK
Definition esp_err.h:23

References ESP_ERR_DSP_PARAM_OUTOFRANGE, and ESP_OK.