Audio ADC beginner questions

Discussion in 'General Electronics Chat' started by diamondman, Nov 23, 2010.

  1. diamondman

    Thread Starter New Member

    May 23, 2010
    19
    0
    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.
     
  2. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    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.
     
  3. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,771
    930
    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
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
  5. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    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.
     
  6. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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.
     
  8. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    RCA plugs, cables, etc., don't modulate anything.
     
  9. diamondman

    Thread Starter New Member

    May 23, 2010
    19
    0
    @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?
     
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    I don't think FW rectified audio is gonna sound right.:D
     
  11. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    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:
     
    diamondman likes this.
  12. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    diamondman likes this.
  13. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
    diamondman likes this.
  14. diamondman

    Thread Starter New Member

    May 23, 2010
    19
    0
    @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.
     
  15. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Your TVs line out vary in voltage. Line out should be <2V pp http://en.wikipedia.org/wiki/Line_level
    Not sure how fast your AVR can switch it's single A/D between the two channels or its maximum sample rate. Is your AVR fast enough to do anything with the data? Where's it going to store it?
     
    diamondman likes this.
  16. diamondman

    Thread Starter New Member

    May 23, 2010
    19
    0
    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
     
  17. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    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.
     
    diamondman likes this.
  18. diamondman

    Thread Starter New Member

    May 23, 2010
    19
    0
    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 ;).
     
  19. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Am I missing something? What do you mean by this?
     
  20. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    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?
     
    diamondman likes this.
Loading...