Tweaked parameters to reduce false positives, especially on fax detection.

git-svn-id: http://voip.null.ro/svn/yate@1336 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-05-24 13:43:39 +00:00
parent f89e91a673
commit ca348fe210
1 changed files with 4 additions and 2 deletions

View File

@ -32,10 +32,12 @@ namespace { // anonymous
// remember the values below are squares, we compute in power, not amplitude
// how much we keep from old value when averaging, must be below 1
#define MOVING_AVG_KEEP 0.97
// minimum square of signal energy to even consider detecting
#define THRESHOLD2_ABS 1e+06
// relative square of spectral power from total signal power
#define THRESHOLD2_REL_FAX 0.85
#define THRESHOLD2_REL_FAX 0.95
// sum of tones (low+high) from total
#define THRESHOLD2_REL_ALL 0.60
// each tone from threshold from total
@ -188,7 +190,7 @@ static char s_tableDtmf[][5] = {
// Update a moving average with square of value (so we end with ~ power)
static void updatePwr(double& avg, double val)
{
avg = 0.95*avg + 0.05*val*val;
avg = MOVING_AVG_KEEP*avg + (1-MOVING_AVG_KEEP)*val*val;
}