Audio ADC beginner questions

Thread Starter

diamondman

Joined May 23, 2010
19
I have been doing a bit of work with Atmel microcontrollers, and decided it was time to try out the ADC, and what better test than with audio. My overall goal is to hook RCA plugs (from a sterio or tv) into the device and read the audio from it into a digital format. So here are my questions.

Audio circuits exists that modulate the current of an audio signal, and the voltage of an audio signal. For voltage modulation the input voltage would have to be scaled down and shifted so that the most negative input voltage reaches the ADC as 0V and the most positive allowed input voltage would reach the ADC as the source voltage for the chip (Please tell me if I am wrong).

But since I am trying to use RCA (which I believe modulates the current) I am at a complete loss on how to convert this to a voltage, let alone what current should reach the adc as 0v and Vcc

I have a few more possibly questions based on the above ones, but simply being provided with a basic circuit to accomplish my RCA to ADC problem would likely clear up most of my misunderstandings.

Any input is greatly appreciated. Thanks in advanced.
 

Jaguarjoe

Joined Apr 7, 2010
767
The ADC is a DC device. It won't respond well to a rapidly varying input such as audio. I know what an RCA plug is, but what do the other two RCA references mean? I think all of the signals in a TV or stereo are voltage modulated.
 

Kermit2

Joined Feb 5, 2010
4,159
a large value cap will couple the Audio and translate its DC voltage level.

Trying to get the max and min level in your ADC's input is desirable, but if you exceed those limits BAD things happen in digital conversion land. Best to set your max limit high and be sure your input won't exceed it. lowers overall resolution of the input signal, but prevents converter 'OVERFLOW' errors
 

GetDeviceInfo

Joined Jun 7, 2009
2,286
Audio isn't the best place to start given your device. Your going to require at least 3x your resolved frequency, but more important, you need to do something with the data stream.

If it's audio that your specifically interested in, I'd suggest looking into dedicated devices. If it's playing with your atmel, I'd suggest something with a much lower sampling rate.
 

Audioguru

Joined Dec 20, 2007
11,248
An audio signal has an AC voltage that goes positive and negative. The negative part might destroy a micro-controller and the peak positive voltage might be too high which will also destroy a micro-controller.
You need to attenuate and clamp the signal to 5V peak-to peak then full-wave rectify it so no signal is 0V and peak signal is +5V.
 

t06afre

Joined May 11, 2009
5,934
Some questions come to mind. I do not know Atmel MCUs. But I doubt the onboard ADC is more than 10 bit. And 10 bit is not much for the full audio frequency range. But it will perhaps do for speach only. What are you going to do with your data? You must have plans about this.
 

Thread Starter

diamondman

Joined May 23, 2010
19
@jaguarjoe: http://en.wikipedia.org/wiki/RCA_connector
@t06afre: You are correct. 10 but ADC is the norm on atmel devices. I am going to be processing very low quality data. I will likely use http://en.wikipedia.org/wiki/Pulse-code_modulation
@audioguru: This is why I am asking how to do this because i don't want to pump a negative voltage or a negative current straight into a mcu... I don't like things exploding (figuratively).
@kermit2:won't just putting it through a capacitor give me negative voltages? And if so, can I just put that through an opamp to get a nice input for my mcu.

The general attitude seems ADCs are not used for audio acquisition... but I see that DACs are used for audio GENERATION (again tell me if i am wrong, but this is the only way i know to get an analog signal from a digital one besides PWM). If I am not supposed to use the ADC, how SHOULD i convert a varying current audio signal to a digital signal of decent quality?
 

Ron H

Joined Apr 14, 2005
7,063
An audio signal has an AC voltage that goes positive and negative. The negative part might destroy a micro-controller and the peak positive voltage might be too high which will also destroy a micro-controller.
You need to attenuate and clamp the signal to 5V peak-to peak then full-wave rectify it so no signal is 0V and peak signal is +5V.
I don't think FW rectified audio is gonna sound right.:D
 

kubeek

Joined Sep 20, 2005
5,796
The general attitude seems ADCs are not used for audio acquisition... but I see that DACs are used for audio GENERATION (again tell me if i am wrong, but this is the only way i know to get an analog signal from a digital one besides PWM). If I am not supposed to use the ADC, how SHOULD i convert a varying current audio signal to a digital signal of decent quality?
ADC means analog to digital conversion, so they have to be what is used for capturing audio. The proper way of preparing the signal will be along these lines:
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
I don't think FW rectified audio is gonna sound right.:D
It will sound like the best guitar fuzz ever heard. It will have so much distortion that it will sound very, very, very, very nasty.

I think only deaf people like fuzz because they cannot hear the many harmonics. I am old but saved my hearing (no guns) so I can still hear very high audio frequencies that "sizzle". Fuzz is distortion that sounds bad to me. Live sounds have no distortion if the electronics and speaker are working properly.
 

Thread Starter

diamondman

Joined May 23, 2010
19
@kubeek That looks like a varying voltage source... will this work for currect changes?
@getDeviceInfo That is a nice ADC, but it still detects voltage. Since RCA jacks use change in current, should i like, use 2 adcs on either side of a resistor and use ohm's law to find out the current, or use a cap as suggested earlier?

also, thanks to everyone who replied. I really appreciate it.
 

Thread Starter

diamondman

Joined May 23, 2010
19
My AVR is 66mhz and 32 bit which i believe is fast enough. I am going to multicast the data over the network after some quick encoding (as much as i can do with my mcu) so storage is not an issue... just proc power
 
Which AVR is 32bit? What's the ADC capture and switching speed? What sort of network Ethernet? RS485?

You could just use an old PC / Laptop and use its soundcard to capture data to WAV. It'll outperform your AVR. Ubuntu probably has an audio capture program. Easy.
 

Thread Starter

diamondman

Joined May 23, 2010
19
Believe me I have looked at that option, but I am going to need multiple of these (8 or more) on a network, so using lots of computers is highly unpractical, but thanks for the thought.
I was looking at http://www.atmel.com/dyn/resources/prod_documents/doc32058.pdf since it is 32 bit, 66mhz, has floating point, built in Ethernet, a decent ADC (though I may use the max adc suggested earlier since it has much better resolution). The Ethernet supports RJ45.
from the doc:
Ethernet MAC 10/100 Mbps interface
– 802.3 Ethernet Media Access Controller
– Supports Media Independent Interface (MII) and Reduced MII (RMII)
I am still looking into MII (since before now I had not heard of this standard) and determining if I will need an external network chip, but I was assuming I would try and keep this thread as specific as possible ;).
 
Really nice part, do you have the skills and experience needed to program it? It's not going to be a cakewalk by any means. Your custom built HW / SW will cost you more than a handful of PCs.

There are audio to ethernet streamers available. What's it going to stream to? Are you trying to broadcast it like shoutcast?

PS why would anyone want to capture TV audio? What are you watching?
 
Top