/* file: fbc.h */ /* make sure this file is only included once */ #ifndef __ISIP_FBC #define __ISIP_FBC #ifndef __ISIP_FFT #include "/u0/brown/4012/fft/include/fourier_transform.h" #define __ISIP_FFT #endif /* system include files */ #include #include #include #include #include /* important definitions */ #define PROGRAM_NAME "EE4012: Feedback Cancelor" #define L_FALSE 0 #define L_TRUE 1 #define SSPL_ERROR 1 #define SSPL_NO_ERROR 0 #define ISIP_ERROR 1 #define ISIP_NO_ERROR 0 #define MAX_STRING_LENGTH 1024 #define BYTES_PER_SAMPLE 2 /* local functions */ extern "C" { int fbc_cmdl_0_C(char* output_file, char* input_file, float& sample_frequency, int& fft_num, float& frame_duration, float& window_duration, int argc, char** argv); int fbc_check_0_C(int argc, char** argv); int fbc_get_0_C(char* output_file, char* input_file, float& sample_frequency, int& fft_num, float& frame_duration, float& window_duration, int argc, char** argv); int fbc_get_1_C(float& sample_frequency, float& frame_duration, float& window_duration, char* param_file); int fbc_comp_0_C(float* buffer_out, float* buffer_in, float sample_frequency, float frame_duration, float window_duration); int fbc_read_0_C(float* buffer_in, FILE* fp_in, int frame_duration, float sample_frequency, float frame_duration, float window_duration); int fbc_write_0_C(float* filtered_frame, FILE* fp_out, float sample_frequency, float frame_duration); int fbc_detect_C (double* fft_out, float threshold, float bandwidth, float& center_freq, float max, int fft_num, float sample_frequency); int fbc_detect2_C (double* fft_out, float threshold_const2, float bandwidth, float* center_freq2, float* max2, int fft_num, float sample_frequency, int& num_maximums2, int frame_number); int fbc_filter_C(float* buffer_out, float frame_dur_samples, float* filtered_frame, float a1, float a2, float b1, float b2, float& yn1, float& yn2, float& xn1, float& xn2, float& a1_prev, float& a2_prev, float& b1_prev, float& b2_prev, int frame_number); int fbc_coef_C(float center_freq, float sample_frequency, float bandwidth, float& a1, float& a2, float& b1, float& b2); float fbc_round_C(float value); int fbc_do_fft_C(char* input_file, float sample_frequency, int fft_num, char* output_fft); } /* end of file */ #endif