/*Test enviornment for testing of the signal path on a generic platform (pc)*/ #include #include "../signalProcessing/include/signal_path.h" int main(int argc, char* argv[]){ /*Some environment related prints*/ #ifdef DEBUG_PRINTS printf("The size of int in bytes is: %lu\n", sizeof(int)); printf("The size of accum_t in bytes is: %lu\n", sizeof(accum_t)); #endif static SingleSignalPath cSensorSignal; static SingleSignalPath accSensorSignal; //static LmsFilter lms; //int lms_fir_coeffs[MAX_FIR_COEFFS]; static int16_t cSensor[BLOCK_LEN], accSensor[BLOCK_LEN]; static int16_t output_port[BLOCK_LEN]; // Deactivate preemphasis filter by initializing with coefficients {1., 0., 0., 0., 0.} // can not be modeled on a generic platform (pc) // biquad filter coefficients - off double b0[5]={1., 0., 0., 0., 0.}; double b1[5]={1., 0., 0., 0., 0.}; int N_lms_fir_coeffs = MAX_FIR_COEFFS; // get parameters from command line OutputMode mode = (OutputMode) (*argv[1] - '0'); // Convert char to int (only works for single digits) int pipe_input = (*argv[2] - '0'); int return_coeffs = (*argv[3] - '0'); init( &cSensorSignal, &accSensorSignal, //&lms, lms_fir_coeffs, b0, b1, 0, // sample delay 0, 1., // weight 1., 0.005, // lms learning rate N_lms_fir_coeffs // Numer of lms fir coefficients ); if (mode == OUTPUT_MODE_FIR){ //FIR filter mit fixen coeffizienten for (int i=0; i