cheb_05.cc

来自「这是一个从音频信号里提取特征参量的程序」· CC 代码 · 共 74 行

CC
74 行
字号
// file: $isip/class/numeric/Chebyshev/cheb_05.cc// version: $Id: cheb_05.cc,v 1.2 2001/07/04 23:58:10 picone Exp $//// isip include files//#include "Chebyshev.h"// method: compute//// arguments://  float& output: (output) computed value//  float input: (input) independent variable//  long order: (input) order of the Chebyshev function//// return: a boolean value indicating status//boolean Chebyshev::compute(float& output_a, float input_a, long order_a) {  // check the order  //  if (order_a < 0) {    return Error::handle(name(), L"compute", Error::ARG, __FILE__, __LINE__);  }  // branch on the input value  //  if (Integral::abs(input_a) <= 1.0) {    output_a = Integral::cos((float)order_a * Integral::acos(input_a));  }  else {    output_a = Integral::cosh((float)order_a * Integral::acosh(input_a));      }  // exit gracefully  //  return true;}// method: compute//// arguments://  VectorFloat& output: (output) computed values//  const VectorFloat& input: (input) independent variables//  long order: (input) order of the Chebyshev function//// return: a boolean value indicating status//boolean Chebyshev::compute(VectorFloat& output_a,			   const VectorFloat& input_a, long order_a) {  // create space in the output vector  //  if (!output_a.setLength(input_a.length())) {    return false;  }  // loop over all elements  //  long len = input_a.length();  float tmp;      for (long i = 0; i < len; i++) {    if (!compute(tmp, input_a(i), order_a)) {      return false;    }    output_a(i) = tmp;  }  // exit gracefully  //  return true;}

⌨️ 快捷键说明

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