Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bigbaby
Beginner
123 Views

DTMF detect issue

Hi,
Everybody! I want to use dtmf detect function of ipp, and I know this is provided through ipp-samples. But I found it has some problem.

First I run ipp-samples/speech-codec/build_intel64.sh to build
second, enter the directory: ipp-samples/speech-codecs/_bin/intel64_gcc4/bin, and here you will find "usc_tones".
Then, I get a pcm file(8000Hz, 16bit) a.pcm, which contain some DTMF digit signal
At last use this ./usc_tones -type DTMF -dt -f8000 a.pcm out", and output is "88505"

But the first "8" should not be detected, because this signal is too short( not more than 30ms )

So I check the file : ipp-samples/speech-codecs/codec/speech/td/src/usc_dtmf.c and add some "printf" in it

and do again, output is :

Start processing.
Input file: a.pcm
Output file: out

Tone detections.
### td/src/usc_dtmf.c: 313 pIppTDParams->dtmf_fs: 77
### td/src/usc_dtmf.c: 313 pIppTDParams->dtmf_fs: 154
### td/src/usc_dtmf.c: 313 pIppTDParams->dtmf_fs: 231
### td/src/usc_dtmf.c: 388 pIppTDParams->hlen(dtmf_fs): 231
### td/src/usc_dtmf.c: 395 pIppTDParams->hlen: 308
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 385
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 400 detect: 8 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 411 pIppTDParams->hlen: 0
8### td/src/usc_dtmf.c: 395 pIppTDParams->hlen: 77
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 154
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 231
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 308
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 385
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 539
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 616
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 693
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 770
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 847
### td/src/usc_dtmf.c: 400 detect: 8 pIppTDParams->hlen: 847
### td/src/usc_dtmf.c: 411 pIppTDParams->hlen: 0
8### td/src/usc_dtmf.c: 395 pIppTDParams->hlen: 77
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 154
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 231
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 308
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 385
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 539
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 616
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 693
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 770
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 847
### td/src/usc_dtmf.c: 400 detect: 5 pIppTDParams->hlen: 847
### td/src/usc_dtmf.c: 411 pIppTDParams->hlen: 0
5### td/src/usc_dtmf.c: 395 pIppTDParams->hlen: 77
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 154
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 231
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 308
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 385
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 539
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 616
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 693
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 770
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 847
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 924
### td/src/usc_dtmf.c: 400 detect: 0 pIppTDParams->hlen: 924
### td/src/usc_dtmf.c: 411 pIppTDParams->hlen: 0
0### td/src/usc_dtmf.c: 395 pIppTDParams->hlen: 77
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 154
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 231
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 308
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 385
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 539
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 616
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 693
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 770
### td/src/usc_dtmf.c: 400 detect: 5 pIppTDParams->hlen: 770
### td/src/usc_dtmf.c: 411 pIppTDParams->hlen: 0
5
Finish.


We can see through output below, "hlen" is bigger than it should be: 462, and this cause the first digit '8' is detected.
I don't know why this var is initialized by dtmf_fs at biginning(file usc_dtmf.c line 387), but I beleive some problems exists here.

Are there some Intel guys can help me? Thanks !

### td/src/usc_dtmf.c: 313 pIppTDParams->dtmf_fs: 77
### td/src/usc_dtmf.c: 313 pIppTDParams->dtmf_fs: 154
### td/src/usc_dtmf.c: 313 pIppTDParams->dtmf_fs: 231
### td/src/usc_dtmf.c: 388 pIppTDParams->hlen(dtmf_fs): 231
### td/src/usc_dtmf.c: 395 pIppTDParams->hlen: 308
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 385
### td/src/usc_dtmf.c: 418 pIppTDParams->hlen: 462
### td/src/usc_dtmf.c: 400 detect: 8 pIppTDParams->hlen: 462

0 Kudos
8 Replies
bigbaby
Beginner
123 Views

Nobody can help me ?
bigbaby
Beginner
123 Views

Nobody ?myself DING!
Chao_Y_Intel
Employee
123 Views

Hello,

Thanks for the patience. I will check some information with some expert, and may provide some update.

Regards,
Chao

Chao_Y_Intel
Employee
123 Views

Hi,

Here is some inputs for the problems:

The DTMF sample is used to demonstrate some usage of related IPP functions. It is developed according to the ITU Q.23 specification. It is very general and there arent any restrictions regarding tone length in that specification. Some restricted false detections are possible. If you have some specific usage, or improvement on that detection, it needs your further development with the source code.

Thanks,
Chao
bigbaby
Beginner
123 Views

HI,
Thanks for your replay, but I still feel disappoint with this.
To the sample code, I think it want to detect the tone which length is longer than 40ms.(hlen >= 320).
You really don't care about the bug in sample code ?
OKohl
Beginner
123 Views

I just have a few remarks (I'm not an Intel Employee):

1. Note that 'pIppTDParams->hlen' is given in bytes (not msec)
2. From a first glimpse of the code I would guess that 'pIppTDParams->hlen' is not set to 0
if 'toneCandidate' changes between two consecutive frames (not sure though).

good luck


bigbaby
Beginner
123 Views

thanks for your reply.

1 hlen is given in samples(2bytes), not bytes. So 320 means 40ms while sampling rate is 8000
2 I feel problem occurs at the beginning, hlen is set to a too big value, so the first digit will be mis-detected. But at the subsequence detection, it works well.
OKohl
Beginner
123 Views

Hey,

I miss understood something: At first you described the digit "8" was false-detected but it should not have been detected because it is too short (only 30 msec). Now you wrote the digit was miss-detected...which is it?

Could it be that the dtmf is simply not synchronized with the sampled frames (of ~30 msec),
so the first frame partialy contains dtmf 8 and the tone is not positivily detected, therefore only at the following frame it is detected?
Reply