XCORE SDK
XCORE Software Development Kit
ns_state.h
1 // Copyright 2022 XMOS LIMITED.
2 // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3 #ifndef NS_STATE_H
4 #define NS_STATE_H
5 
6 #include <bfp_math.h>
7 
25 #define NS_FRAME_ADVANCE (240)
26 
31 #define NS_PROC_FRAME_LENGTH (512)
32 
38 #define NS_PROC_FRAME_BINS ((NS_PROC_FRAME_LENGTH / 2) + 1)
39 
44 #define NS_INT_EXP (-31)
45 
50 #define NS_WINDOW_LENGTH (480)
51 
62 typedef struct {
63 
64  //Dynamic MCRA filter coefficients
77 
79  int32_t data_S [NS_PROC_FRAME_BINS];
81  int32_t data_S_min [NS_PROC_FRAME_BINS];
83  int32_t data_S_tmp [NS_PROC_FRAME_BINS];
85  int32_t data_p [NS_PROC_FRAME_BINS];
87  int32_t data_adt [NS_PROC_FRAME_BINS];
89  int32_t data_lambda_hat [NS_PROC_FRAME_BINS];
90 
91  //Data needed for the frame packing and windowing
100 
102  int32_t data_prev_frame [NS_PROC_FRAME_LENGTH - NS_FRAME_ADVANCE];
104  int32_t data_ovelap [NS_FRAME_ADVANCE];
106  int32_t data_rev_wind [NS_WINDOW_LENGTH / 2];
107 
108  //Static MCRA filter coefficients
109  //If modifying any parameters, modify one_minus parameters as well!
124 
126  unsigned reset_period;
128  unsigned reset_counter;
129 
130 } ns_state_t;
131 
132 #endif
#define NS_PROC_FRAME_LENGTH
Definition: ns_state.h:31
#define NS_PROC_FRAME_BINS
Definition: ns_state.h:38
#define NS_WINDOW_LENGTH
Definition: ns_state.h:50
#define NS_FRAME_ADVANCE
Length of the frame of data on which the NS will operate.
Definition: ns_state.h:25
A block floating-point vector of 32-bit elements.
Definition: xs3_math_types.h:276
A floating-point scalar with a 32-bit mantissa.
Definition: xs3_math_types.h:167
NS state structure.
Definition: ns_state.h:62
float_s32_t alpha_d
Definition: ns_state.h:113
unsigned reset_period
Definition: ns_state.h:126
bfp_s32_t S_tmp
Definition: ns_state.h:70
bfp_s32_t p
Definition: ns_state.h:72
float_s32_t alpha_p
Definition: ns_state.h:117
float_s32_t one_minus_aplha_d
Definition: ns_state.h:119
bfp_s32_t S
Definition: ns_state.h:66
float_s32_t delta
Definition: ns_state.h:111
bfp_s32_t lambda_hat
Definition: ns_state.h:76
bfp_s32_t rev_wind
Definition: ns_state.h:99
bfp_s32_t S_min
Definition: ns_state.h:68
bfp_s32_t wind
Definition: ns_state.h:97
bfp_s32_t alpha_d_tilde
Definition: ns_state.h:74
float_s32_t one_minus_alpha_s
Definition: ns_state.h:121
unsigned reset_counter
Definition: ns_state.h:128
float_s32_t one_minus_alpha_p
Definition: ns_state.h:123
bfp_s32_t prev_frame
Definition: ns_state.h:93
bfp_s32_t overlap
Definition: ns_state.h:95
float_s32_t alpha_s
Definition: ns_state.h:115