简体   繁体   English

通过Android手机中的声音进行通信

[英]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 . 我正在使用android的Tonegenerator生成声音,其中1表示为http://developer.android.com/reference/android/media/ToneGenerator.html#TONE_DTMF_0,0表示为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? 现在,当我将生成的声音录制并保存到另一部手机中时,如何从声音中解码o和1?

If you have only two tones to detect, you can use FFT (Fast Fourrier Transform) to detect which tones have been received. 如果仅要检测两个音调,则可以使用FFT(快速傅里叶变换)来检测已接收到哪些音调。 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. 您将面临的问题是确定每个位要执行多少个采样:如果采样太多,则可能会出现在两个音调上进行FFT的问题。 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). 快速浏览Wikipedia可以发现有两种技术可以用来做到这一点:第一种是使用经过调谐的滤波器组(我猜是在可能的频率附近带通)。 The other one is indeed using some FFTs and some pre-processing. 另一个确实使用一些FFT和一些预处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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