📄 mel_05.cc
字号:
// file: $isip/class/numeric/Mel/mel_05.cc// version: $Id: mel_05.cc,v 1.4 2001/06/09 03:19:15 picone Exp $//// isip include files//#include "Mel.h"// method: compute//// arguments:// float& mel: (output) mel-scaled data // float freq: (input) frequency in Hz//// return: a boolean value indicating status//// this method maps the input data from one scale to another via a// nonlinear Mel transformation, given by following equation://// mel = A * log10(1 + freq * B)//boolean Mel::compute(float& mel_a, float freq_a) { // compute the value // mel_a = A * Integral::log10(1.0 + freq_a * B); // exit gracefully // return true;}// method: compute//// arguments:// VectorFloat& mel: (output) mel-scaled data// const VectorFloat& freq: (input) frequency data in Hz//// return: a boolean value indicating status//// this method maps the input data from one scale to another via a// nonlinear mel transformation//boolean Mel::compute(VectorFloat& mel_a, const VectorFloat& freq_a) { // declare local variables // long length = freq_a.length(); float tmp; boolean status = true; // allocate space // mel_a.setLength(length, false); // loop over elements and call the single input / single output // compute method // for (long k = 0; k < length ; k++) { status = compute(tmp, (float)freq_a(k)); mel_a(k) = tmp; } // exit gracefully // return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -