Digital Signal Processing LibraryVoice LabProgram name: read_25 Language: C In file: file_lib.c Objective: Read data from file. If sample rate is 50K, throw out the even samples, leaving an efective 25K sample rate. Usage: int read_25(FILE *in_file, int data_size, int sample_rate, int *result); Parameters:
Mathematical Description: Comments: Routine is used to read data file and return a value. If sample rate is 50K, downsample to 25K Code: int read_25(FILE *in_file, int data_size, int sample_rate, int *result) { int i, count; count = read_data(in_file, data_size, sample_rate, result); if(sample_rate == 50000) { /* Throw out the even data, reducing the data rate to 25000 */ read_data(in_file, data_size, sample_rate, &i); } return(count); } |
English Version > Documents and tutorials > D.Sc. projects > Routines for DSP > file_lib >