XCORE SDK
XCORE Software Development Kit
ic_state.h
1 // Copyright 2022 XMOS LIMITED.
2 // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3 #ifndef IC_STATE_H
4 #define IC_STATE_H
5 
6 #include "ic_defines.h"
7 
8 
37 typedef struct {
42  uint8_t bypass;
44  int32_t gamma_log2;
46  uint32_t sigma_xx_shift;
53 
54 
67 typedef struct {
72 
77 
83 
85  uint8_t enable_adaption;
91 
93 
94 
104 typedef struct {
107 
112 
117 
121 
122 
133 typedef struct {
140  int32_t DWORD_ALIGNED y[IC_Y_CHANNELS][IC_FRAME_LENGTH + FFT_PADDING];
141 
148  int32_t DWORD_ALIGNED x[IC_X_CHANNELS][IC_FRAME_LENGTH + FFT_PADDING];
149 
153  int32_t DWORD_ALIGNED y_prev_samples[IC_Y_CHANNELS][IC_FRAME_LENGTH - IC_FRAME_ADVANCE]; //272 samples history
157  int32_t DWORD_ALIGNED x_prev_samples[IC_X_CHANNELS][IC_FRAME_LENGTH - IC_FRAME_ADVANCE]; //272 samples history
158 
159 
164 
172 
177 
184 
188 
190  bfp_s32_t inv_X_energy_bfp[IC_X_CHANNELS];
192  int32_t DWORD_ALIGNED inv_X_energy[IC_X_CHANNELS][IC_FD_FRAME_LENGTH];
194  bfp_s32_t X_energy_bfp[IC_X_CHANNELS];
196  int32_t DWORD_ALIGNED X_energy[IC_X_CHANNELS][IC_FD_FRAME_LENGTH];
199 
201  bfp_s32_t overlap_bfp[IC_Y_CHANNELS];
203  int32_t DWORD_ALIGNED overlap[IC_Y_CHANNELS][IC_FRAME_OVERLAP];
204 
206  int32_t y_input_delay[IC_Y_CHANNELS][IC_Y_CHANNEL_DELAY_SAMPS];
208  uint32_t y_delay_idx[IC_Y_CHANNELS];
209 
213  float_s32_t error_ema_energy[IC_Y_CHANNELS];
215  float_s32_t max_X_energy[IC_X_CHANNELS];
216 
218  bfp_s32_t sigma_XX_bfp[IC_X_CHANNELS];
220  int32_t DWORD_ALIGNED sigma_XX[IC_X_CHANNELS][IC_FD_FRAME_LENGTH];
221 
223  float_s32_t sum_X_energy[IC_X_CHANNELS];
224 
229 } ic_state_t;
230 
231 #endif
#define IC_Y_CHANNEL_DELAY_SAMPS
Definition: ic_defines.h:51
#define FFT_PADDING
Definition: ic_defines.h:143
#define IC_X_CHANNELS
Definition: ic_defines.h:109
#define IC_FRAME_LENGTH
Definition: ic_defines.h:117
#define IC_FRAME_ADVANCE
IC new samples frame size This is the number of samples of new data that the IC works on every frame....
Definition: ic_defines.h:126
#define IC_Y_CHANNELS
Definition: ic_defines.h:101
#define IC_FILTER_PHASES
Definition: ic_defines.h:45
#define IC_FD_FRAME_LENGTH
Definition: ic_defines.h:135
int32_t fixed_s32_t
A 32-bit fixed-point scalar.
Definition: xs3_math_types.h:128
[bfp_s16_t]
Definition: xs3_math_types.h:340
A block floating-point vector of 32-bit elements.
Definition: xs3_math_types.h:276
A complex number with a 32-bit real part and 32-bit imaginary part.
Definition: xs3_math_types.h:49
A floating-point scalar with a 32-bit mantissa.
Definition: xs3_math_types.h:167
IC adaption controller configuration structure.
Definition: ic_state.h:67
fixed_s32_t energy_alpha_fast_q30
Definition: ic_state.h:76
uint8_t enable_filter_instability_recovery
Definition: ic_state.h:90
fixed_s32_t energy_alpha_slow_q30
Definition: ic_state.h:74
float_s32_t instability_recovery_leakage_alpha
Definition: ic_state.h:82
uint8_t enable_adaption
Definition: ic_state.h:85
float_s32_t voice_chance_alpha
Definition: ic_state.h:71
float_s32_t leakage_alpha
Definition: ic_state.h:69
float_s32_t out_to_in_ratio_limit
Definition: ic_state.h:80
uint8_t enable_adaption_controller
Definition: ic_state.h:87
IC adaption controller state structure.
Definition: ic_state.h:104
ic_adaption_controller_config_t adaption_controller_config
Definition: ic_state.h:119
float_s32_t output_energy_fast
Definition: ic_state.h:116
float_s32_t output_energy_slow
Definition: ic_state.h:111
float_s32_t input_energy_fast
Definition: ic_state.h:114
float_s32_t input_energy_slow
Definition: ic_state.h:109
float_s32_t smoothed_voice_chance
Definition: ic_state.h:106
IC configuration structure.
Definition: ic_state.h:37
float_s32_t delta
Definition: ic_state.h:51
uint32_t sigma_xx_shift
Definition: ic_state.h:46
int32_t gamma_log2
Definition: ic_state.h:44
uint8_t bypass
Definition: ic_state.h:42
fixed_s32_t ema_alpha_q30
Definition: ic_state.h:48
IC state structure.
Definition: ic_state.h:133
ic_config_params_t config_params
Definition: ic_state.h:226
ic_adaption_controller_state_t ic_adaption_controller_state
Definition: ic_state.h:228
unsigned X_energy_recalc_bin
Definition: ic_state.h:198