⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adf_05.cc

📁 这是一个从音频信号里提取特征参量的程序
💻 CC
字号:
// file: $isip/class/mmedia/AudioFile/adf_05.cc// version: $Id: adf_05.cc,v 1.8 2002/06/07 14:31:26 gao Exp $//// isip include files//#include <Console.h>#include "AudioFile.h" // method: clear//// arguments://  Integral::CMODE cmode: (input) clear mode//// return: a boolean value indicating status//// clears the contents of AudioFile and close the file if necessary//boolean AudioFile::clear(Integral::CMODE cmode_a) {  // release resources  //  // we allow stdout and stderr to be deleted without closing. this is  // necessary for the static File object's used in Console.  //  if ((fp_d == (FILE*)stdout) || (fp_d == (FILE*)stderr)) {    close();  }    // close the file if it is still open  //  if (fp_d != (FILE*)NULL) {    // warn the user    //    return Error::handle(name(), L"clear", ERR_NOTCLS,			 __FILE__, __LINE__, Error::WARNING);    // close the file    //    close();  }    resetBuffer();  resetFilter();  if (cmode_a >= Integral::RELEASE) {    // delete internal memory    //    if (io_buf_d != (byte*)NULL) {      scratch_mgr_d.releaseBlock(io_buf_d);      io_buf_d = (byte*)NULL;    }  }  // reset the data members  //  file_type_d = DEF_FILE_TYPE;  file_format_d = DEF_FILE_FORMAT;  compression_type_d = DEF_COMP_TYPE;  amplitude_range_d = DEF_AMPLITUDE_RANGE;  no_data_d = true;  sample_freq_d = DEF_SAMPLE_FREQ;  sample_num_bytes_d = DEF_SAMPLE_NUM_BYTES;  num_channels_d = DEF_NUM_CHANNELS;  sample_precision_d = DEF_SAMPLE_PRECISION;  setMaCoeff(DEF_MA_COEFF);  setArCoeff(DEF_AR_COEFF);        // exit gracefully  //  return true;}// method: resetBuffer//// arguments://  long ctag: (input) channel to clear//// return: a boolean value indicating status//// clear out CircularBuffer, we have no good data//boolean AudioFile::resetBuffer(long ctag_a) {  // process all channels  //  if (ctag_a < 0) {    // loop over all channels    //    for (long i = 0; i < num_channels_d; i++) {      resetBuffer(i);    }    // exit gracefully    //    return true;  }  // clear the buffer  //  buffers_d(ctag_a).clear(Integral::RESET);  // reset time index  //  buf_end_samp_d(ctag_a) = -1;  end_of_file_d = false;    // exit gracefully  //  return true;}// method: resetFilter//// arguments://  long ctag: (input) channel to clear//// return: a boolean value indicating status//// clear out CircularBuffer, we have no good data//boolean AudioFile::resetFilter(long ctag_a) {  // process all channels  //  if (ctag_a < 0) {    // loop over all channels    //    for (long i = 0; i < num_channels_d; i++) {      resetFilter(i);    }    // exit gracefully    //    return true;  }  // clear the filter memory  //  Float f0 = 0.0;  ma_mem_d(ctag_a).clear(Integral::RESET);  for (long i = ma_coeff_d.length() - 1; i >= 0; i--) {    ma_mem_d(ctag_a).append(f0);  }  ma_mem_d(ctag_a).seekCurr(ma_mem_d(ctag_a).getNumForward());  ar_mem_d(ctag_a).clear(Integral::RESET);  for (long i = ar_coeff_d.length() - 1; i >= 0; i--) {    ar_mem_d(ctag_a).append(f0);  }  ar_mem_d(ctag_a).seekCurr(ar_mem_d(ctag_a).getNumForward());  // exit gracefully  //  return true;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -