1 #ifndef __WNR_H__ 2 #define __WNR_H__ 3 4 #include "iirfilt.h" 5 6 typedef struct 7 { 8 int32_t bypass; 9 int lpf_cutoff; 10 int hpf_cutoff; 11 float power_ratio_thr; // ratio of the power spectrum of the lower frequencies over the total power spectrum for all frequencies 12 float power_thr; // normalized power of the low frequencies 13 } WnrConfig; 14 15 struct WnrState_; 16 17 typedef struct WnrState_ WnrState; 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 WnrState* wnr_create(int32_t sample_rate, int32_t frame_size, const WnrConfig *config); 24 25 void wnr_destroy(WnrState *st); 26 27 void wnr_process(WnrState *st, int16_t *buf, int frameSize); 28 29 #ifdef __cplusplus 30 } 31 #endif 32 33 #endif