Bandwidth from headphone/microphone jack
Asked Answered
L

5

23

I got interested in this after I saw Square use the headphone jack on the iPhone to send credit card data.

What's the average bandwidth of the headphone jack on the iPhone, average notebook, and average mobile device?

Can it be doubled by sending different data streams on the different channels (left/right)?

Lithography answered 2/2, 2010 at 2:8 Comment(0)
P
13

One issue is the bandwidth of audio cables, which I won't go into here. As for audio ports, assume a soundcards with a maximum sample rate of 44,100 or 48,000 samples/s at 16 bits/sample/channel, resulting in a maximum bandwidth of 22.05 or 24 kHz (basically a result of the Nyquist-Shannon sampling theorem, though for sound sampling, the sampled signal would also have to be continuous-amplitude for this theorem to apply) and a transfer rate of 176.4 or 192 kBps for stereo.

According to Studio Six Digital, the line-in on the iPhone supports a max sample rate of 48 kHz. The mic on the 3G version also runs at 48 kHz, while the 1st gen iPhone's mic sampled at 8kHz. I haven't been able to find bit depth specs for the iPhone, but I believe it uses 16 bit samples. 24 bit samples is the other possibility.

According to Fortuny over at the Apple forums, who was quoting an Apple Audio Developer Note, the line-in on a MacBook support up to 24 bit samples with a 96 kHz sample rate, for a data rate of 576 kBps. Apple's MacBook External Ports and Connector's page lists the max sample rate as 192 kHz, but they may have switched that with the max sample rate for digital audio using the optical port.

For a rate comparison, phone systems had a sample rate of 8 kHz at 8 bits/sample mono, resulting in a max data rate of 8 kbps. FM has a sample rate of 22.05 kHz at 16 bits/sample/channel and is stereo, resulting in a data rate of 88.2 kBps.

Of course, the above calculations ignore the problem of synchronizing the data stream and error detection and correction, all of which will consume a portion of the signal.

Preview answered 2/2, 2010 at 2:20 Comment(3)
shouldn't peak transfer rate be 176.4 kbps (bits) instead of kBps (bytes)? Can you explain your calculation?Draftsman
@user657429: check your math: 44,100 samples/s * 2 bytes/sample/channel * 2 channels = 176400 bytes/sPreview
You two are comparing apples and oranges: one of you is talking about the data rade to represent samples of the audio signal, the other is talking about the data rate which could be encoded within the audio signal by simple means.Obadias
T
1

Typical audio device maximum is 48Khz stereo, lots of devices can handle 96 Khz.

But course what comes out of the headphone jack is analog, not digital, and it runs through some filters as well on the way out, so some sort of tone modulation is the way to go. There may be some crosstalk between the stereo channels - how much crosstalk will be very device dependent.

0ld style telephone modems could send 9600 baud over standard analog lines that aren't even as clean as your typical headphone jack. And that's MONO. I would think you could get 2400 baud per channel without working too hard.

You might be able to go as high as 100K baud if you were very clever at signal processing. Credit card validation systems were designed to run at 2400 baud mono last time I looked at them, It wouldn't surprise me if they still were given how much inertia there is in point of purchase systems.

Terricolous answered 2/2, 2010 at 2:25 Comment(1)
DVD's are 48Khz, so most sound cards support that now. CD's are so last year :)Terricolous
S
1

I'm not sure if this is correct for all systems but almost all if not all sampling systems use a 1 bit delta modulation system that most likely embedded into the dsp chip set on most portable units. The decimation (changing 1 bit to 16,20 or 24 bit) is done in software and so is the anti aliasing filters. Mind you these dfp chips are being optimized via hardware so as to reduce energy consumption, so there may be a limit to what they could produce via software.

As far as nyquist limitations - these don't really come into context when transferring digital information over well controlled data paths. If you look at modems and the way they transmit information - they use a lot of DSP to send a higher band width by using phase shift keying - which looks at the relative phase shift to the carrier signal timing and can differentiate much smaller increments than the normal doubling of the nyquist limit.(sampling at 44khz while producing at data at 20 khz) so the dsp can see a 10 or 20 degree shift in the carrier frequency compared to the 180 degree shift. this is because you have a reference signal to compare with.

Also the data flow is all broadband spread-spectrum encoded which increases density a whole bunch (lookup jesse russell for broadband and Hedy Lamarr in spread-spectrum)

My laptop does 192khz at 24 bit (dell xrs/14z) or so they say. I usually transfer my audio via network connection to my main studio pc which has a ADAT optical to a remote unit so I get superior noise and cross talk levels. laptops and mobile smart phones are full of digital noise and are physically too small to reduce these issues. Until they get digital headphones (not likely soon) then one has to use discrete systems like they do in a professional recording studios.

Specify answered 21/12, 2014 at 0:22 Comment(0)
P
1

I've put together a library to answer this question for myself. The iPhone has a pretty typical cutoff of around 20kHz, so the data rate you can achieve just depends on how good your SNR is. The relevant theory is the Shannon-Nyquist limit. I've managed to hit roughly 64kbps with this library, and I think more is possible with better tuning

If you'd like to see the library, it's https://github.com/quiet/quiet Live demo: https://quiet.github.io/quiet-js/lab.html

Paulapauldron answered 30/3, 2016 at 18:14 Comment(0)
J
0

20Khz is pretty much the max on any circuit intended to carry audio, because it's pretty much the top of the human ear's frequency response. Given the Nyquist limit, you're probably looking at 10Kb/sec tops. Of course, Back In The Day(TM), we though 9600b/s was high speed, so it might be good enough. And yes, you could double it using stereo output.

Johnnyjohnnycake answered 2/2, 2010 at 2:23 Comment(1)
Such a simple analysis might hold for pure frequency-shift-keying, but there are many other options. Consider that you mention 9600 baud in apparent reference to a telephone audio circuit which only had about 3 KHz of audio bandwidth. Multi-bit encodings such as QAM and beyond which made that possible are even more applicable to a lower noise, higher amplitude resolution channel such as concerned in the question.Obadias

© 2022 - 2024 — McMap. All rights reserved.