# Send analog audio through the rs232 port of a data transmitter

I would like to convert an analog audio signal into an rs232 datafeed to send it through a data transmitter and receive it at the other end. I already have the data transmitter and receiver. Thanks for your answer.

I would like to create a camera communication between the OB van and the wireless camera we have. The problem is, I could do it via a normal radio like Motorola but I have some parts left from my last project. The transmitter and receiver that I have can only communicate with each other via RS232. This was used as a data transmitter to controll the camera. Now I want to use this as this is a narrow band transmitter and it's easier to get a license for this kind of communication.

It is a Line level signal that has to be converted and transmitted. If possible the circuit should be as small as possible.

The transmitter is a link L1128.

• This question is really vague, maybe you can explain a bit more? Are you looking for an ADC maybe? – NeinDochOah Jan 20 '16 at 13:55
• May i know why you have preferred for RS232 communication ? and What is your goal of this by converting (its somewhat challenging and waste of time) audio to RS232. It should need filter,ADC,MCU, MAX232 such big system is required – Photon001 Jan 20 '16 at 14:00
• @Raj "The transmitter and Receiver that I have can only communicate with each other via RS232." So it is what he has lying around. @ OP: please note that the datarate of an RS232 connection is quite low. I doubt if it is high enough for sending sound and pictures. Video you can forget unless postage-stamp size low quality is good enough for you. – Bimpelrekkie Jan 20 '16 at 14:34
• I only want to transmitt sound. – magic7music Jan 20 '16 at 14:35
• Multimedia over RS-232?? Ambitious.. – Eugene Sh. Jan 20 '16 at 14:50

So, let's do a little math.

Your RS232 link, you mention in the comments, has 38400 baud, which in the context of RS232 is typically (one RS232 symbol is only worth one bit) the same as saying 38.4kbit/s(UPDATE: you know suddenly figure out the data rate over the air is 19.2kbit/s MAX, so I'll have to halve the following), assuming this is really the sustainable, and not a best-case, overhead-ignoring, perfect signal conditions number. If I were you, I'd treat the following calculation with a factor of 0.5.

So, let's assume we have 8bit audio samples.

That's pretty baseline. That leaves us with

$\frac{38.4\frac{\text{kbit}}{\text{s}}}{8\frac{\text{bit}}{\text{sample}}} = 4.8 \frac{\text{ksamples}}{\text{s}}\text{.}$

UPDATE: with 19.2kbit/s over the air, the maximum sample rate is half of that, i.e. 2.4ksamples/s, maximum

The Nyquist-Shannon theorem states that with such a $4.8 \frac{\text{ksamples}}{\text{s}}$ sampling rate, the highest frequency is $\frac{4.8 \frac{\text{ksamples}}{\text{s}}}2=2.4\text{kHz}$. That is usually too little for clear communication.

UPDATE: 1.2kHz, see above.

Which means you will have to compress your audio. Now, typical audio compression schemes like those used in GSM can, in fact, make communication over such low-bitrate channels possible, but please be aware that you will have to implement compression/decompression yourself, or use existing ICs to do it for you. In effect, it will be much much easier not to use your existing link but to use a radio that is actually meant to do speech communication out of the box.

• I know it is ambitious but that's what it's all about. I can buy some digital Radios but it`s not the same as building it myself with a little helpfrom my online friends. – magic7music Jan 20 '16 at 16:18
• @magic7music "ambitious" and "not mathematically possible" are two different things. – Scott Seidman Jan 20 '16 at 16:24
• What Scott said, @magic7music. You can not send understandable audio over a 38.4kbit/s link without employing compression; there's mathematical proof it's impossible. Doing compression is a hell of a job for a one man show, unless you've done something like this before, which you, I might quite frankly say, you don't ever seem to have done. There's a lot to be considered, and a lot of theory to be understood before you get into psychoacoustics, source coding, channel coding and audio decoding. – Marcus Müller Jan 20 '16 at 16:37
• Although I don't believe it is technically in the spec, normally RS232 communications use an asynchronous protocol that would require at least 10 bits per data byte (includes start and stop bit). – Tut Jan 20 '16 at 18:18
• @Tut start and stop bits often are subject to configuration. You can do completely without. – Marcus Müller Jan 20 '16 at 18:43

Depending on exactly what you are trying to accomplish, you might be able to do this using pulse-width modulation. If you use a PWM frequency that is well above the highest audio frequency of interest, convert the analog audio level to the width of each pulse (using a ramp generator and comparitor or microcontroller probably), send that PWM signal using the RS-232 transmitter. On the receiver end, just use a low-pass filter on the PWM output and a DC-block cap to recreate the audio signal. If your PWM frquency is close to the highest audio frequency, you will have to use a low-pass filter with a sharp cutoff. If you use a high PWM frequency you might have issues with rise and fall times on the RS-232 tranceivers (and possibly EMI issues).

• This cannot work, because "PWM frequency well above highest frequency of signal" is exactly the Shannon-Nyquist theorem for binary quantization. The same calculation as in my answer applies, but this time with 1-bit samples, if you just turn on or off, or if you've got different PWM duty cycles $\left\lceil\mathrm{log}_2(\text{number of duty cycle intensities})\right\rceil$ bits. – Marcus Müller Jan 20 '16 at 21:30