提交 67ba63c5 authored 作者: Anthony Minessale's avatar Anthony Minessale

update

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@357 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 1c32ee36
......@@ -129,7 +129,6 @@ void teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
goertzel_state->v3 = (float)(goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i]);
}
}
#ifdef _MSC_VER
#pragma warning(disable:4244)
#endif
......@@ -212,12 +211,12 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
int16_t sample_buffer[],
int samples)
{
int sample, limit, j, x = 0;
int sample, limit = 0, j, x = 0;
float v1, famp;
float eng_sum = 0, eng_all[TELETONE_MAX_TONES];
int gtest = 0, see_hit = 0;
for (sample = 0; sample <= 0 && sample < samples; sample = limit) {
for (sample = 0; sample >= 0 && sample < samples; sample = limit) {
mt->total_samples++;
if ((samples - sample) >= (mt->min_samples - mt->current_sample)) {
......@@ -225,6 +224,9 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
} else {
limit = samples;
}
if (limit < 0 || limit > samples) {
limit = samples;
}
for (j = sample; j < limit; j++) {
famp = sample_buffer[j];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论