📄 bark_05.cc
字号:
// file: $isip/class/numeric/Bark/bark_05.cc// version: $Id: bark_05.cc,v 1.4 2001/06/09 03:19:10 picone Exp $//// isip include files//#include "Bark.h"// method: compute//// arguments:// float& bark: (output) equivalent bark scaled value// float freq: (input) frequency value in Hz//// return: a boolean value indicating status//// this method maps the input data from one scale to another via a// nonlinear transformation.//boolean Bark::compute(float& bark_a, float freq_a) { // declare local variables // float tmp1 = A2 * freq_a; float tmp2 = B2 * freq_a; // assign the value // bark_a = A1 * Integral::atan(tmp1) + B1 * Integral::atan(tmp2 * tmp2); // exit gracefully // return true;}// method: compute//// arguments:// VectorFloat& bark: (output) bark-scaled data// const VectorFloat& freq: (input) frequency data in Hz//// return: a boolean value indicating status//// this method maps the freq data to the Bark scale using a nonlinear// transformation.//boolean Bark::compute(VectorFloat& bark_a, const VectorFloat& freq_a) { // declare local variables // long length = freq_a.length(); float tmp; boolean status = true; // allocate space // bark_a.setLength(length, false); // loop over all the data // for (long k = 0; k < length; k++) { status = compute(tmp, (float)freq_a(k)); bark_a(k) = tmp; } // exit gracefully // return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -