Skip to content

Commit

Permalink
updated voice and core modules (#554)
Browse files Browse the repository at this point in the history
fixes for new lib_xcore_math API
  • Loading branch information
keithm-xmos authored Nov 11, 2022
1 parent c6679cf commit df8d571
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/* SDK headers */
#include "xcore_utils.h"
#include "mic_array.h"
#include "bfp_math.h"
#include "xmath/xmath.h"

/* App headers */
#include "app_conf.h"
Expand Down Expand Up @@ -69,7 +69,7 @@ void ap_stage_b(chanend_t c_input, chanend_t c_output, chanend_t c_from_gpio) {
// update the gain
float power = (float)gain_db / 20.0;
float gain_fl = powf(10.0, power);
float_s32_t gain = float_to_float_s32(gain_fl);
float_s32_t gain = f32_to_float_s32(gain_fl);
// scale both channels
bfp_s32_scale(&ch0, &ch0, gain);
bfp_s32_scale(&ch1, &ch1, gain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void stage0(int32_t * audio_frame)
// convert dB to amplitude
float power = (float)xStage0_Gain / 20.0;
float gain_fl = powf(10.0, power);
float_s32_t gain = float_to_float_s32(gain_fl);
float_s32_t gain = f32_to_float_s32(gain_fl);
// scale both channels
bfp_s32_scale(&ch0, &ch0, gain);
bfp_s32_scale(&ch1, &ch1, gain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "rtos_mic_array.h"
#include "rtos_i2s.h"
#include "bfp_math.h"
#include "xmath/xmath.h"

enum {
GET_GAIN_VAL = 1,
Expand Down
2 changes: 1 addition & 1 deletion modules/io
2 changes: 1 addition & 1 deletion modules/voice
Submodule voice updated from 549e70 to 918dec

0 comments on commit df8d571

Please sign in to comment.