3
\$\begingroup\$

We have a platform based around the LPC1313 -- 72Mhz M3. This, and many other microcontrollers with similar specs look limited to 10 or 12 bit A2D.

If I want to sample single channel 16 bit (16kHz) audio, what are my design options?

\$\endgroup\$
  • \$\begingroup\$ What the other guys said is all true. I'd like to add that a 16-bit "AUDIO" ADC or DAC is actually hard to find these days. Almost all of them are 24-bit. It's OK to simply throw-away the extra bits if you don't need them or can't use them. And you are not really paying extra money for those unused bits. \$\endgroup\$ – user3624 Feb 7 '12 at 0:34
5
\$\begingroup\$

At a system design level, there are four basic ways to do audio:

The first is to use the onboard ADC and/or DACs included with your microcontroller. On your LPC1313, you don't have a DAC; you'd have to upgrade to an LPC17xx to get this. You could also choose a different controller (scrap the LPC1313) which has the required onboard peripherals. This is a good choice if audio quality isn't a big deal for your project, space is a major constraint, and your processor has the required peripherals. This isn't a good choice if audio quality is extremely important, if you can't change microcontrollers. I'm not sure what your target application is, but if you're doing anything other than reproducing music, the 12-bit ADC on the LPC1313 should be fine.

The second would be to use a microprocessor which has the required peripherals as a slave processor, and communicate with the master over SPI or other protocol. This is a good idea if you need to do some preprocessing of your audio and your host doesn't have the bandwidth to do so: even cheap DSPs can efficiently and transparently do basic filtering before your host sees the data. This isn't a good idea if you're space or cost constrained, you'll likely waste a lot of silicon and board space on unused components on the slave chip. Parts like the Analog Devices ADAU17xx line blur the distinction between DSPs and codecs; an ADAU1781 would be a good choice for an audio frontend controller.

The third method is to build your own from discrete ADCs, DACs, and op-amps. This gives you the best control over the results, and if you want to spend the money you can build a 'perfect' system, but it's going to be difficult and expensive. You may be able to find an ADC specifically designed for audio, TI has 18 dedicated to this purpose.

The fourth and IMO best solution is to use a dedicated audio encoder/decoder. This type of chip is known as a "codec". The chip will integrate ADCs and DACs which are ideally suited for stereo audio into a single package, and you can address it over a serial link from your microcontroller. You may or may not need an amplifier, depending on your output. Examples would be parts like the NXP UDA1344 or the TI AIC3104. These are almost always a good choice, because they're simple to design for, conserve board space over discrete components, and offer very high quality. There's probably a codec chip in most of the audio devices you use. They can be expensive (though not when compared to an equivalent-quality system), and they don't do much without a dedicated host processor, but they're the standard choice.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the great answer. I have another follow-up on shipping data over serial from the codec. Ultimately I want 16kHz,16bit PCM. I've heard that to do this well and avoid noise, I need to get the codec to sample at a higher rate (cf. Nyquist), send to the uC and downsample-and-average the values there (to (anti-alias). This adds a burden on the microcontroller to deal with the higher (>2x16kHz) sample rate. Won't the codec be doing this anti-aliasing for me if I ask it for 16kHz,16bit. \$\endgroup\$ – user48956 Feb 11 '12 at 2:19
4
\$\begingroup\$

A separate ADC chip will allow you to match the converter to what ever CPU you need for the design. Digi-Key has thousands to choose from.

\$\endgroup\$
1
\$\begingroup\$

Incidentally, one thing worth noting about digital-to-analog converters is that while a 16-bit converter (ADC or DAC) should in theory have a ~90dB signal-to-noise ratio regardless of signal content (with more than one LSB of noise, one may as well have a 15-bit or smaller converter), a lot of converter chips designed for things like PC audio have characteristics that will vary with the signal being produced. For example, when gain is set for one volt full scale, they may be able to reproduce a 1mv signal with only 0.05mV of noise or other deviation from "ideal", but when reproducing a one-volt signal, there may be more than 5mV of noise or deviation. When sampling or generating audio for the purpose of having someone listen to it, such behavior is probably fine. It may be problematic, however, if you are intending to use an audio-frequency signal for other purposes.

\$\endgroup\$
  • \$\begingroup\$ Your whole answer is about DACs while his whole question is about ADCs. Am I missing something? \$\endgroup\$ – Kellenjb Feb 6 '12 at 22:27
  • \$\begingroup\$ Sorry. The exact same factors apply to both; I'll edit my answer to reflect that. \$\endgroup\$ – supercat Feb 6 '12 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.