kamalmostafa / minimodem

general-purpose software audio FSK modem
http://www.whence.com/minimodem
Other
846 stars 113 forks source link

send data over inaudible sound? #15

Closed flavius-mester closed 8 years ago

flavius-mester commented 9 years ago

Firstly a big Well Done! Secondly, can the program be used to send data over inaudible sound? in high frequency range? If not, would it be hard for the current project to be changed to support that?

many thanks

AideTechBot commented 9 years ago

Yep, I actually did this so I can confirm its possible. Just pipe the output to any audio player like a play or something and change the frequencies to anything above 20KHz. It's been a while I've done this so I don't know the exact syntax but it's only a matter of changing the mark and stop frequencies.

darkyen commented 9 years ago

Adult humans cannot hear 19 khz in general (actually the number varies around 17.8 ish) so any digital audio player should be fine.

kamalmostafa commented 8 years ago

I often get asked about minimodem and ultrasound. Here are a some notes and examples for ultrasound experimenters:

First, a simple (easy to "hear") example: 100 baud, and we'll force the mark frequency to 1000 Hz and the space frequency to 3000 Hz:

​$ echo hello | minimodem --tx 100 -M 1000 -S 3000​

Now, the same exact thing, but lets save the audio to a .wav file, then read that .wav file back to confirm:

$ echo hello | minimodem --tx 100 -M 1000 -S 3000 -f /tmp/audio.wav

$ minimodem --rx 100 -M 1000 -S 3000 -f /tmp/audio.wav
### CARRIER 100 @ 1000.0 Hz ###
hello

### NOCARRIER ndata=6 confidence=2159036.500 ampl=1.000 bps=100.00 (rate perfect) ###

Okay, now in order to make ultrasound actually work, you'll need to increase the default audio sample rate from 48 KHz to 96 Khz with the -R switch. Lets try that just to make sure it works (but don't change mark and space just yet, so you can verify that you hear the tones the same as the first example): ​

​$ echo hello | minimodem --tx 100 -M 1000 -S 3000​ -R 96000

Okay now lets try ultrasound... Increase the mark and space frequencies, say to 20000 Hz and 30000 Hz:

$ echo hello | minimodem --tx 100 -M 20000 -S 30000 -R 96000

With that, I can barely hear a faint buzz.

Lets verify that it actually encodes and decodes data in the ultrasound range. For this final test, I'll feed it a lot more data (the text of the minimodem manual page), and also increase the data rate to 5000 baud to keep the resulting audio.wav file from becoming too huge:

$ man minimodem | minimodem --tx 5000 -M 20000 -S 30000 -R 96000 -f /tmp/audio.wav

$ minimodem --rx 5000 -M 20000 -S 30000  -f /tmp/audio.wav

{text of the man page is displayed}

Yes, it works! If I try playing the /tmp/audio.wav file with an audio file player, again, I can barely hear a faint buzz.

Higher frequencies will work fine as well. More tips: