简体   繁体   中英

Communication through sound in android phones

I am generating sound using android's Tonegenerator in which 1 is represented by http://developer.android.com/reference/android/media/ToneGenerator.html#TONE_DTMF_0 and 0 is represented by http://developer.android.com/reference/android/media/ToneGenerator.html#TONE_DTMF_6 . Now when I record and save this generated sound in another phone, how can the o's and 1's can be decoded from the sound?

If you have only two tones to detect, you can use FFT (Fast Fourrier Transform) to detect which tones have been received. The problem you will face is to determine on how many samples to do that for each bit : if you take too many, you may have the problem where your FFT will be done over two tones. You can either add a synchronization sequence at the beginning of the transmission to be sure to be synchronized, or you can add some "silence" between two tones transmitted.

A quick look into Wikipedia shows that two techniques are used to do this : the first one is to use a filter bank with filters tuned (I guess to be bandpass around the possible frequencies). The other one is indeed using some FFTs and some pre-processing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM