#include #include #include #include "idc.h" void usage(void); /******************************************************************************* *NOTICE: * *This code is believed by the author to be bug free. You are free to use and * *modify this code with the understanding that any use, either direct or * *derivative, must contain acknowledgement of its author and source. The author* *makes no warranty of any kind, expressed or implied, of merchantability or * *fitness for a particular purpose. The author shall not be held liable for any* *incidental or consequential damages in connection with or arising out of the * *furnishing, performance, or use of this software. This software is not * *authorized for use in life support devices or systems. * ********************************************************************************/ main(int argc, char *argv[]) { int size, num, i; float error, sqrerror, abserror, sigpower, mse, mae, sig, snr; short *aufile1, *aufile2; /* get filesize for the first audio file */ get_file_size(argv[1],&size); num = size/2; fprintf(stderr,"Number of data points is %d\n",num); /* get memory for the audio or speech file */ aufile1 = (short *) calloc(num+8,sizeof(short)); aufile2 = (short *) calloc(num+8,sizeof(short)); /* Get the audio data */ readau(argv[1],aufile1); readau(argv[2],aufile2); /* Compute performance metrics */ sqrerror = 0.0; abserror = 0.0; sigpower = 0.0; for(i=0; i