Android, transmit a signal using ultrasound
android, audio, mobile, signals
Solution
Creating an ultra sound is just a matter of playing a sound which contains very high pitches (small wavelength). Sounds are played through electronic devices by quickly changing the power of an electromagnet which is attached to a membrane which vibrates accordingly (a speaker). Sounds can be played at varying levels of granularity, but some speakers may be able to keep up with the signal sent much better than others.
You can construct an artificial wave that thrashes the power quickly from high to low, and any given device will probably reproduce that signal with varying degrees of success. The better it keeps up, the closer it will get to the true volume of the signal. If it doesn't keep up very well, you may only get a tiny vibration rather than the large vibration you sent. In other words, you may find that you can produce the ultrasound frequency you want, but it not in a high enough volume to be useful. And it will definitely vary by device.
Also, it should be noted that ultrasound just means something that is a higher pitch than we can hear. Some people (particularly teenagers) can hear much higher pitches than others. So there is some wiggle room in the definition of ultrasound. But ultimately, these phones' speakers are optimized for playing sounds that we can all hear, and the higher you try to stretch the equipment outside of its intended range, the more limitations you are likely to find in its performance.
If you want to experiment, look up the specs on different sound formats. I think .wav may be the one that you will find the simplest, and therefore the easiest to experiment with. Then construct your sound file according to that spec to make large, fast waves. For example, if the signal power ranges from 0 to 255, you can try a pattern like 0, 127, 255, 127, 0, 127, 255, etc. or even just try 0, 255, 0, 255, 0, which would be one octave higher. And see if you can record something of that wave on another device. (Because you aren't going to hear it with your ear.)
By the way, you will also find that that simply producing the signal is the easy part. If you want to "transmit", then your other device is going to have to hear the signal. But of course, what it actually hears will be mixed with all of the back ground noise in the room, so separating that one frequency from the rest of the noise involves some math. You'll need to get familiar with terms like Fourier Transform. The math is out there. It has already been worked out. But you'll have to work out how to apply that complex math to the problem of sorting out when this frequency is being heard. If you love math, this will be a fun project.
Problem
Please tell me how do I create an ultra sound with an android phone? If you already have a code sample? Thank you!