Data Communication via Audio
Simon_Ampleman
Posts: 7
Hello,
·· I would like to achieve data communication on a audio cable that connects between the propeller and a old PC Sound Card Microphone Input.
···I've seen the Bell 202 object (AFSK 1200 BPS) which works fine.
···However, since I am directly connected between the microcontroller and the PC with a short length cable, I am wondering if I could achieve a faster speed and a faster to decode algorithm (in terms of cpu operation) on the PC.
·· The PC has a standard sound card, so it·records at fast rate (up to 48000hz) with 8 or 16 bits per sample.
···If possible, I would like the PC to receive 1600 decoded bits per second·(200 decoded bytes/sec)·with a minimum cpu usage.
·· As I understand, the AFSK 1200 BPS·can achieve·872·decoded bits per second·(1 start bit, 8 data bits, 2 stops bits). And the PC needs to calculate Fourier Power Coefficient on 19200 sub-samples per second. That is a lot of operation I would like to avoid.
·· Any idea? Any standard protocol exists ?
Thank you!
Simon
·· I would like to achieve data communication on a audio cable that connects between the propeller and a old PC Sound Card Microphone Input.
···I've seen the Bell 202 object (AFSK 1200 BPS) which works fine.
···However, since I am directly connected between the microcontroller and the PC with a short length cable, I am wondering if I could achieve a faster speed and a faster to decode algorithm (in terms of cpu operation) on the PC.
·· The PC has a standard sound card, so it·records at fast rate (up to 48000hz) with 8 or 16 bits per sample.
···If possible, I would like the PC to receive 1600 decoded bits per second·(200 decoded bytes/sec)·with a minimum cpu usage.
·· As I understand, the AFSK 1200 BPS·can achieve·872·decoded bits per second·(1 start bit, 8 data bits, 2 stops bits). And the PC needs to calculate Fourier Power Coefficient on 19200 sub-samples per second. That is a lot of operation I would like to avoid.
·· Any idea? Any standard protocol exists ?
Thank you!
Simon
Comments
All of these faster protocols are more complex than the Bell 202 standard (similar to V.23) and the coding / decoding process is more complicated.
If you're directly connected via a short length cable, why not use digital signalling and bypass the sound card completely. Does your PC have a spare serial port? Does it have USB so you could use a USB to serial converter?
If you're handling specific data, how about compressing it so that you get higher throughput over a 1200 BPS channel? How about encoding whatever data you want to transfer?
I want to use the audio port since I want to run my final project on iPhone, Palm Pre, Zune·and·Android.
Audio recording is always available and doesn't require to use custom connector different for each platform and their specific libraries (when available).
I thought that I·could simply use a simple·115200 bps N-8-1 protocol on·the audio·line or manchester encoding...
44000hz 8 bits sampling (352000 bps?) would be enough to read that signal, right? Why to use FSK ?
I·am·a software developer, so I can code it, but have no idea about the physical·limitation yet...·I've seen that the·BeauNet protocol can share data between two·propeller at amazing speed... The sound card·might not·have a fast enough sampling rate to achieve this particular speed, but·I can't believe it cannot·deliver more than 1200 bps...
I·don't want to add compression yet because I have a very limited number of cpu cycles·for the audio task and also because I would like to·get near·0·ms·latency.
Thank you,
Simon
http://en.wikipedia.org/wiki/Quadrature_amplitude_modulation
·
If you want to use relatively simple encoding you probably won't get much more than 1200 bits per second out of a normal monaural audio channel, and that won't be very reliable and will depend a lot on the architecture of the receiving amplifiers, ADC, and encoding scheme. I once had an off-brand 8 bit PC (circa 1977) that achieved 1200 baud on cassette tapes (when others, like the TRS-80, were doing 300 baud) by using clicks and timing the interval between clicks to differentiate between 1 and 0. On the platforms of interest to you you might even be able to get 2400 or even 4800 baud with a similar scheme. And it has the advantage of being very easy to decode with simple circuitry and simple software. But if you want to go any faster, you will need a lot of black magic both in hardware and software to make it reliable at all.
www.hartetechnologies.com/manuals/PolyMorphic/Poly%2088%20Cassette%20Interface.pdf (p. 26 ff.)
-Phil
Simon