dtmf_detect_state 190 src/include/private/libteletone_detect.h TELETONE_API(void) teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate); dtmf_detect_state 199 src/include/private/libteletone_detect.h TELETONE_API(int) teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state, dtmf_detect_state 209 src/include/private/libteletone_detect.h TELETONE_API(int) teletone_dtmf_get (teletone_dtmf_detect_state_t *dtmf_detect_state, dtmf_detect_state 105 src/libteletone_detect.c TELETONE_API(void) teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate) dtmf_detect_state 110 src/libteletone_detect.c dtmf_detect_state->hit1 = dtmf_detect_state->hit2 = 0; dtmf_detect_state 125 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->row_out[i], &dtmf_detect_row[i]); dtmf_detect_state 126 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->col_out[i], &dtmf_detect_col[i]); dtmf_detect_state 127 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->row_out2nd[i], &dtmf_detect_row_2nd[i]); dtmf_detect_state 128 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->col_out2nd[i], &dtmf_detect_col_2nd[i]); dtmf_detect_state 130 src/libteletone_detect.c dtmf_detect_state->energy = 0.0; dtmf_detect_state 132 src/libteletone_detect.c dtmf_detect_state->current_sample = 0; dtmf_detect_state 133 src/libteletone_detect.c dtmf_detect_state->detected_digits = 0; dtmf_detect_state 134 src/libteletone_detect.c dtmf_detect_state->lost_digits = 0; dtmf_detect_state 135 src/libteletone_detect.c dtmf_detect_state->digits[0] = '\0'; dtmf_detect_state 136 src/libteletone_detect.c dtmf_detect_state->mhit = 0; dtmf_detect_state 269 src/libteletone_detect.c TELETONE_API(int) teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state, dtmf_detect_state 288 src/libteletone_detect.c if ((samples - sample) >= (BLOCK_LEN - dtmf_detect_state->current_sample)) { dtmf_detect_state 289 src/libteletone_detect.c limit = sample + (BLOCK_LEN - dtmf_detect_state->current_sample); dtmf_detect_state 298 src/libteletone_detect.c dtmf_detect_state->energy += famp*famp; dtmf_detect_state 301 src/libteletone_detect.c v1 = dtmf_detect_state->row_out[x].v2; dtmf_detect_state 302 src/libteletone_detect.c dtmf_detect_state->row_out[x].v2 = dtmf_detect_state->row_out[x].v3; dtmf_detect_state 303 src/libteletone_detect.c dtmf_detect_state->row_out[x].v3 = (float)(dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp); dtmf_detect_state 305 src/libteletone_detect.c v1 = dtmf_detect_state->col_out[x].v2; dtmf_detect_state 306 src/libteletone_detect.c dtmf_detect_state->col_out[x].v2 = dtmf_detect_state->col_out[x].v3; dtmf_detect_state 307 src/libteletone_detect.c dtmf_detect_state->col_out[x].v3 = (float)(dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp); dtmf_detect_state 309 src/libteletone_detect.c v1 = dtmf_detect_state->col_out2nd[x].v2; dtmf_detect_state 310 src/libteletone_detect.c dtmf_detect_state->col_out2nd[x].v2 = dtmf_detect_state->col_out2nd[x].v3; dtmf_detect_state 311 src/libteletone_detect.c dtmf_detect_state->col_out2nd[x].v3 = (float)(dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp); dtmf_detect_state 313 src/libteletone_detect.c v1 = dtmf_detect_state->row_out2nd[x].v2; dtmf_detect_state 314 src/libteletone_detect.c dtmf_detect_state->row_out2nd[x].v2 = dtmf_detect_state->row_out2nd[x].v3; dtmf_detect_state 315 src/libteletone_detect.c dtmf_detect_state->row_out2nd[x].v3 = (float)(dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp); dtmf_detect_state 320 src/libteletone_detect.c dtmf_detect_state->current_sample += (limit - sample); dtmf_detect_state 321 src/libteletone_detect.c if (dtmf_detect_state->current_sample < BLOCK_LEN) { dtmf_detect_state 326 src/libteletone_detect.c row_energy[0] = teletone_goertzel_result (&dtmf_detect_state->row_out[0]); dtmf_detect_state 327 src/libteletone_detect.c col_energy[0] = teletone_goertzel_result (&dtmf_detect_state->col_out[0]); dtmf_detect_state 330 src/libteletone_detect.c row_energy[i] = teletone_goertzel_result (&dtmf_detect_state->row_out[i]); dtmf_detect_state 334 src/libteletone_detect.c col_energy[i] = teletone_goertzel_result (&dtmf_detect_state->col_out[i]); dtmf_detect_state 353 src/libteletone_detect.c if (i >= GRID_FACTOR && (row_energy[best_row] + col_energy[best_col]) > 42.0*dtmf_detect_state->energy && dtmf_detect_state 354 src/libteletone_detect.c teletone_goertzel_result (&dtmf_detect_state->col_out2nd[best_col])*DTMF_2ND_HARMONIC_COL < col_energy[best_col] && dtmf_detect_state 355 src/libteletone_detect.c teletone_goertzel_result (&dtmf_detect_state->row_out2nd[best_row])*DTMF_2ND_HARMONIC_ROW < row_energy[best_row]) { dtmf_detect_state 364 src/libteletone_detect.c if (hit == dtmf_detect_state->hit3 && dtmf_detect_state->hit3 != dtmf_detect_state->hit2) { dtmf_detect_state 365 src/libteletone_detect.c dtmf_detect_state->mhit = hit; dtmf_detect_state 366 src/libteletone_detect.c dtmf_detect_state->digit_hits[(best_row << 2) + best_col]++; dtmf_detect_state 367 src/libteletone_detect.c dtmf_detect_state->detected_digits++; dtmf_detect_state 368 src/libteletone_detect.c if (dtmf_detect_state->current_digits < TELETONE_MAX_DTMF_DIGITS) { dtmf_detect_state 369 src/libteletone_detect.c dtmf_detect_state->digits[dtmf_detect_state->current_digits++] = hit; dtmf_detect_state 370 src/libteletone_detect.c dtmf_detect_state->digits[dtmf_detect_state->current_digits] = '\0'; dtmf_detect_state 374 src/libteletone_detect.c dtmf_detect_state->lost_digits++; dtmf_detect_state 379 src/libteletone_detect.c dtmf_detect_state->hit1 = dtmf_detect_state->hit2; dtmf_detect_state 380 src/libteletone_detect.c dtmf_detect_state->hit2 = dtmf_detect_state->hit3; dtmf_detect_state 381 src/libteletone_detect.c dtmf_detect_state->hit3 = hit; dtmf_detect_state 384 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->row_out[i], &dtmf_detect_row[i]); dtmf_detect_state 385 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->col_out[i], &dtmf_detect_col[i]); dtmf_detect_state 386 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->row_out2nd[i], &dtmf_detect_row_2nd[i]); dtmf_detect_state 387 src/libteletone_detect.c goertzel_init (&dtmf_detect_state->col_out2nd[i], &dtmf_detect_col_2nd[i]); dtmf_detect_state 389 src/libteletone_detect.c dtmf_detect_state->energy = 0.0; dtmf_detect_state 390 src/libteletone_detect.c dtmf_detect_state->current_sample = 0; dtmf_detect_state 392 src/libteletone_detect.c if ((!dtmf_detect_state->mhit) || (dtmf_detect_state->mhit != hit)) { dtmf_detect_state 393 src/libteletone_detect.c dtmf_detect_state->mhit = 0; dtmf_detect_state 400 src/libteletone_detect.c TELETONE_API(int) teletone_dtmf_get (teletone_dtmf_detect_state_t *dtmf_detect_state, dtmf_detect_state 404 src/libteletone_detect.c teletone_assert(dtmf_detect_state->current_digits <= TELETONE_MAX_DTMF_DIGITS); dtmf_detect_state 406 src/libteletone_detect.c if (max > dtmf_detect_state->current_digits) { dtmf_detect_state 407 src/libteletone_detect.c max = dtmf_detect_state->current_digits; dtmf_detect_state 410 src/libteletone_detect.c memcpy (buf, dtmf_detect_state->digits, max); dtmf_detect_state 411 src/libteletone_detect.c memmove (dtmf_detect_state->digits, dtmf_detect_state->digits + max, dtmf_detect_state->current_digits - max); dtmf_detect_state 412 src/libteletone_detect.c dtmf_detect_state->current_digits -= max;