News for hackers. Stuff that matters.
Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @01:43PM (#17333365)
Author here, thanks for posting this :)

Would be happy to answer any question.

Re:Audio Modem Communication Library in Python by zaarn on Monday June 18, 2018 @07:38AM (#17337418)
How reliably does this work over FM transmission or VoIP? (If it doesn't I would guess and say that you'd have to add some mechanism to detect reliable frequency bands like in existing modems)
Re:Audio Modem Communication Library in Python by roman_zeyde on Monday June 18, 2018 @03:04PM (#17340808)
Unfortunately, VoIP doesn't allow reliable OFDM communication... It's preferable to transmit and receive the audio as-is (without any compression).
Re:Audio Modem Communication Library in Python by ggerganov on Sunday June 17, 2018 @02:03PM (#17333466)
In your experience, how reliable is the communication between 2 devices when using speakers and microphone (no cable) at distance ~3 meters? What bandwidth do you typically achieve in such conditions?
Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @02:14PM (#17333524)
~3 meters is indeed quite a challenging scenario. I've tested it with the lowest bit-rate supported (1 kbps), but it doesn't work reliably.

You can try my Android app [1] to reproduce the experiments for short transmissions.

[1] https://play.google.com/store/apps/details?id=bit.zeyde.audi...

Re:Audio Modem Communication Library in Python by ChuckMcM on Sunday June 17, 2018 @02:39PM (#17333624)
Nicely done, I'll note for the readership here that a similar technique works fine at 300 baud across the room using FSK.

Something you might consider is to write a web camera backend for it and use the screen/webcam. That has a lot more bandwidth and has higher SNR as the selector effect of the web camera is so much better than that of a microphone.

Re:Audio Modem Communication Library in Python by brian-armstrong on Sunday June 17, 2018 @03:12PM (#17333800)
FSK across the room? Does that have noise restrictions?

I’ve found all the phase modulation schemes work poorly across the room. DSSS works ok but is very slow. I would be curious how reliable FSK is in that situation.

Re:Audio Modem Communication Library in Python by ChuckMcM on Sunday June 17, 2018 @06:13PM (#17334616)
With 1270Hz/1070Hz you've got over 3 complete cycles to identify the tone at 300 baud, at higher frequency pairs it gets better. The person who wrote it was Tom Lyon at Sun but I bet I could reproduce it with a gnuradio-companion flow graph. That would make it pretty easy for anyone to play with it.
Re:Audio Modem Communication Library in Python by brian-armstrong on Sunday June 17, 2018 @06:52PM (#17334830)
Interesting, I will have to give it a try then. Thanks!
Re:Audio Modem Communication Library in Python by darkmighty on Sunday June 17, 2018 @06:41PM (#17334771)
I don't have first hand experience but I believe a big problem with sound channels is multipath propagation/challenging frequency response. FSK naturally deals quite well with those; it's similar to OFDM but more robust due to single carried symbols. You can extend the symbol period as long as you like while using an adequate number. Finally in challenging environments it'd a good idea to use error correction, not just error detection as done here -- you can (in theory) achieve reliable transmission over arbitrarily noisy channels by adding redundancy.
Re:Audio Modem Communication Library in Python by ggerganov on Sunday June 17, 2018 @08:01PM (#17335071)
I have experimented with FSK modulation myself and was able to achieve quite reliable transmission across the room [1]. Although the bandwidth is quite low (8-16 B/s), it works most of the time.

[1] https://ggerganov.github.io/jekyll/update/2018/05/31/data-ov...

Re:Audio Modem Communication Library in Python by brian-armstrong on Sunday June 17, 2018 @10:51PM (#17335697)
Neat library!

Your post mentions not finding any reliable modem libraries. I'm curious what issues you had with mine, if you tried it?

https://quiet.github.io/quiet-js

Re:Audio Modem Communication Library in Python by ggerganov on Monday June 18, 2018 @10:37AM (#17338557)
Hi, I did try it and it was working quite good when the devices (phone and laptop) were within ~30 cm. After increasing the distance and putting on the TV in the background it wasn't working that well any longer. I tried only the default protocol with audible frequencies (the ultrasound option didn't work, but my phone does not support the ultrasound option with my application too. guess it's hardware limitation).

I am willing to sacrifice bandwidth to achieve better reliability of the communication and I believe I was able to achieve it. Although, I haven't done tests with many other devices/conditions than my own, so my result might be biased.

Re:Audio Modem Communication Library in Python by brian-armstrong on Monday June 18, 2018 @05:38PM (#17341880)
Interesting. What modulation does yours use?
Re:Audio Modem Communication Library in Python by noir_lord on Sunday June 17, 2018 @05:26PM (#17334416)
hmm, if you where using a screen/webcam, could you do something horribly crude like flash QR codes and leverage their EC?.
Re:Audio Modem Communication Library in Python by ChuckMcM on Sunday June 17, 2018 @06:16PM (#17334631)
Funny you should mention that, I wrote exactly that sort of link using my QR clock code (tweet embedded video of same: https://twitter.com/ChuckMcManis/status/794025248203022336)
Re:Audio Modem Communication Library in Python by Dowwie on Sunday June 17, 2018 @01:56PM (#17333427)
Very cool concept! Radio stations used to share software over the airwaves by using something like this.

How long would it take to transmit a 3MB jpeg and then encode it,?

Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @02:19PM (#17333544)
Thanks!

Using an audio cable (for better SNR), I have managed to achieve and sustain 60kbps for long periods time - so 3MB file should take ~7 minutes to transmit.

Re:Audio Modem Communication Library in Python by jedberg on Sunday June 17, 2018 @03:21PM (#17333839)
I’m wondering, did you build this just to see if you could, or did you have a use case in mind?
Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @04:08PM (#17334065)
Both :)

The initial use-case was performing air-gapped communication for signing Bitcoin transactions [1] on an offline machine.

[1] https://github.com/spesmilo/electrum/pull/964

Re:Audio Modem Communication Library in Python by brian-armstrong on Sunday June 17, 2018 @06:58PM (#17334858)
Do you have ideas or plans on how to increase the transmit speed?
Re:Audio Modem Communication Library in Python by roman_zeyde on Monday June 18, 2018 @01:21AM (#17336143)
The original goal was transmitting ~10kB in a few seconds over an audio cable, so I didn't try to improve the transmission speed much further. I guess that adding error correction coding will allow increasing the highest possible bit-rate (currently I'm using only CRC-32 for error detection).
Re:Audio Modem Communication Library in Python by codezero on Sunday June 17, 2018 @03:55PM (#17333991)
Was this inspired by any of the dialup modem protocols?
Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @04:04PM (#17334030)
Indeed, I am using OFDM [1], which uses several carriers, each modulated via QAM [2].

[1] https://en.wikipedia.org/wiki/Orthogonal_frequency-division_...

[2] https://en.wikipedia.org/wiki/Quadrature_amplitude_modulatio...

Re:Audio Modem Communication Library in Python by viraptor on Sunday June 17, 2018 @10:54PM (#17335706)
I'm a bit confused. How does QAM work with audio if you have only one channel rather than I/Q? Are you using multiple frequencies for that?
Re:Audio Modem Communication Library in Python by roman_zeyde on Monday June 18, 2018 @02:34AM (#17336335)
QAM is using both carrier's amplitude and phase to encode information, so I/Q can be thought as [1]:

  I = amplitude*cos(phase)
  Q = amplitude*sin(phase)
[1] http://whiteboard.ping.se/SDR/IQ
Re:Audio Modem Communication Library in Python by viraptor on Monday June 18, 2018 @05:41AM (#17336923)
I'm just sitting here and staring at this sentence: "The modulated signal rides on a carrier of a given frequency, but the base band signal got no fixed frequency at all. Because of this, we have the possibility to encode the two-dimensional I/Q signal onto the one-dimensional RF signal without losing anything." I may need to sleep on it...
Re:Audio Modem Communication Library in Python by someguydave on Sunday June 17, 2018 @04:15PM (#17334105)
Have you tested this software on macos?
Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @04:23PM (#17334151)
No, I've used it only on my Linux machine.

I guess it should also work on MacOS, since it depends on `numpy` [1] and `portaudio19-dev` [2] Debian packages (which should be installable via Pip/Homebrew).

[1] http://www.numpy.org/

[2] https://people.csail.mit.edu/hubert/pyaudio/

Re:Audio Modem Communication Library in Python by jacob019 on Sunday June 17, 2018 @02:02PM (#17333461)
Can work above the audible spectrum?
Re:Audio Modem Communication Library in Python by roman_zeyde on Sunday June 17, 2018 @02:17PM (#17333533)
Currently, it does not - mainly because I've tried to use all available bandwidth (to increase the bit-rate).

Please take a look at https://github.com/quiet/quiet-js for an ultrasonic data transmission.