作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试实现用于语音 Activity 检测的能量阈值算法,而对于大小为wL的帧,没有获得有意义的能量值。
wL = 1784 // about 40 ms (
const double decay_constant = 0.90 // some optimal value between 0 and 1
double prevrms = 1.0 // avoid DivideByZero
double threshold = some optimal value after some experimentation
for (int i = 0; i < noSamples ; i += wL)
{
for (int j = 0; j < wL; j++)
{
// Exponential decay
total = total * decay_constant;
total += (audioSample[j] * audioSample[j]); // sum of squares
}
double mean = total / wL;
double rms = Math.Round(Math.Sqrt(mean),2); // root mean sqare
double prevrms = 1.0;
if(rms/prevrms > threshold)
{
// voice detected
}
prevrms = rms;
rms = 0.0;
}
rms
计算为0.19。
// WAV file information
Sampling Frequency: 44100 Bits Per Sample: 16
Channels: 2 nBlockAlign: 4 wavdata size: 557941248 bytes
Duration: 3162.932 sec Samples: 139485312 Time between samples: 0.0227 ms
Byte position at start of samples: 44 bytes (0x2C)
Chosen first sample to display: 1 (0.000 ms)
Chosen end sample to display: 1784 (40.431 ms)
16 bit max possible value is: 32767 (0x7FFF)
16 bit min possible value is: -32768 (0x8000)
最佳答案
我发现了问题。我的第二个for循环未正确设置。基本上,第二个for循环应如下所示:
for(j = i; j <= i + wL ;j++)
for(j = 0; j < wL; j++)
关于speech-recognition - 发出实现能量阈值算法以进行语音事件检测的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6071432/
很简单的问题,可能很难回答: 例如,将 SSE 指令用于并行 sum/min/max/average 运算是否比执行任何其他指令(例如单个和)消耗更多的功率? 例如,在 Wikipedia我找不到这方
我想使用流体库的模型。谁能解释一下(我是建模/模拟的新手):质量/能量/动量平衡的公式:稳态、动态和初始猜测初始固定-->之间有什么区别以及对初始化时间/计算的影响是什么时间;我什么时候需要哪一个。
我是一名优秀的程序员,十分优秀!