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

Go to the source code of this file.

#define dsps_mulc_f32   dsps_mulc_f32_ansi
#define dsps_mulc_s16   dsps_mulc_s16_ansi
esp_err_t dsps_mulc_f32_ansi (const float *input, float *output, int len, float C, int step_in, int step_out)
 multiply constant
esp_err_t dsps_mulc_f32_ae32 (const float *input, float *output, int len, float C, int step_in, int step_out)
esp_err_t dsps_mulc_s16_ae32 (const int16_t *input, int16_t *output, int len, int16_t C, int step_in, int step_out)
esp_err_t dsps_mulc_s16_ansi (const int16_t *input, int16_t *output, int len, int16_t C, int step_in, int step_out)

Macro Definition Documentation

◆ dsps_mulc_f32

#define dsps_mulc_f32   dsps_mulc_f32_ansi

Definition at line 69 of file dsps_mulc.h.

◆ dsps_mulc_s16

#define dsps_mulc_s16   dsps_mulc_s16_ansi

Definition at line 70 of file dsps_mulc.h.

Function Documentation

◆ dsps_mulc_f32_ae32()

esp_err_t dsps_mulc_f32_ae32 ( const float * input,
float * output,
int len,
float C,
int step_in,
int step_out )

References C.

◆ dsps_mulc_f32_ansi()

esp_err_t dsps_mulc_f32_ansi ( const float * input,
float * output,
int len,
float C,
int step_in,
int step_out )

multiply constant

The function multiplies input array to the constant value x[i*step_out] = y[i*step_in]*C; i=[0..len) The implementation use ANSI C and could be compiled and run on any platform

Parameters
[in]inputinput array
outputoutput array
lenamount of operations for arrays
Cconstant value
step_instep over input array (by default should be 1)
step_outstep over output array (by default should be 1)
Returns
  • ESP_OK on success
  • One of the error codes from DSP library

Definition at line 17 of file dsps_mulc_f32_ansi.c.

18{
19 if (NULL == input) {
21 }
22 if (NULL == output) {
24 }
25
26 for (int i = 0 ; i < len ; i++) {
27 output[i * step_out] = input[i * step_in] * C;
28 }
29 return ESP_OK;
30}
#define ESP_ERR_DSP_PARAM_OUTOFRANGE
#define ESP_OK
Definition esp_err.h:23
float C[4][16]
Definition test_mmult.c:22

References C, ESP_ERR_DSP_PARAM_OUTOFRANGE, and ESP_OK.

Referenced by audio_read_task(), audio_read_task(), audio_read_task(), dspm::Mat::operator*=(), and dspm::Mat::operator/=().

Here is the caller graph for this function:

◆ dsps_mulc_s16_ae32()

esp_err_t dsps_mulc_s16_ae32 ( const int16_t * input,
int16_t * output,
int len,
int16_t C,
int step_in,
int step_out )

References C.

◆ dsps_mulc_s16_ansi()

esp_err_t dsps_mulc_s16_ansi ( const int16_t * input,
int16_t * output,
int len,
int16_t C,
int step_in,
int step_out )

Definition at line 17 of file dsps_mulc_s16_ansi.c.

18{
19 if (NULL == input) {
21 }
22 if (NULL == output) {
24 }
25
26 for (int i = 0 ; i < len ; i++) {
27 int32_t acc = (int32_t)input[i * step_in] * (int32_t)C;
28 output[i * step_out] = (int16_t)(acc >> 15);
29 }
30 return ESP_OK;
31}

References C, ESP_ERR_DSP_PARAM_OUTOFRANGE, and ESP_OK.