<div>Hi</div><div> </div><div>I've been testing mod_avmd and got a lot of false positives - i.e. normal speech detected as beep. As I understand it, the basic approach is to look for audio with one very dominant frequency - the beep. It does this by getting a frequency estimate and then calculats the amplitude of the audio at that frequency, looking for a consistent run of high amplitudes. But I've found a few things that are either not right or I have misunderstood:</div>
<div> </div><div>1. The expensive desa2 frequency estimate is calculated on every sample, and worse, as each frame arrives (say 160 samples) it calculates the desa2 for every sample in the circular buffer - 800 samples (rounded up to 1024 I think?). So that is using excessive CPU, and anyway I don't think the frequency estimate should be calculated on every sample, because in normal speech, the frequency is changing and so successive samples might register a high amplitude but with different frequencies, causing false positives. <br>
2. The amplitude function doesn't appear to produce a constant result when the input audio is a pure tone, although the deas2 frequency estimate is close.<br>3. The running mean sma_b is tested against zero - which basically means any positive amplitude meeting the "valid" cases will count as a detected beep.</div>
<div> </div><div>I have re-worked mod_avmd.c to:</div><div><br>1. Calculate the frequency only once every 10ms (sine len).<br>2. Calculate the running variance of frequency over the required beep length (100ms) - ie. last 10 estimates.</div>
<div> </div><div>This is producing good results - would welcome comment & if anyone else can try it that would be great. Could be further tided up as it doesn't really require a circular buffer for samples at all - could just do the desa2 calculation direct from the sample buffer, at least once per frame (2 per frame for 8000kHz, 20ms frames). Also, goertzel.c isn't used by the module at all, and amplitude.c isn't used in my version and can be removed.</div>
<div> </div><div>Raised as <a href="http://jira.freeswitch.org/browse/FS-4090">http://jira.freeswitch.org/browse/FS-4090</a> with proposed patch.</div><div> </div><div>Regards</div><div> </div><div>David</div><div><br> </div>
<div> </div><div> </div>