ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_h_gen.h File Reference
#include "dsp_err.h"
Include dependency graph for dsps_h_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_h_gen_f32 (float *output, int len, int pos)
 Heviside function.

Function Documentation

◆ dsps_h_gen_f32()

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

Heviside function.

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

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

Definition at line 17 of file dsps_h_gen.c.

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

References ESP_ERR_DSP_PARAM_OUTOFRANGE, and ESP_OK.