Electronic – Looking for a microcontroller for Audio DSP applications

audiodspmicrocontrollerspi

I'm currently researching a system that has the ability to playback multiple sound files from an SD-card, add them together then output the signal to a DAC.
I'm basically looking for specifications on how fast the SPI port of any given DSP microcontroller would need be to playback 16 tracks (or alternatively 1 track * 16) simultaneously, the sampling frequency is 44.1kHz standard CD quality for each track. And if anybody knows a good microcontroller (with strong development documentation) for this application..

This feat is the only bottle neck I can currently see in the overall system design, if I can overcome this 16 track playback hurdle, it's all downhill from here.

EDIT:

The equipment will have preset audio tracks on the SD card stored as .wav on FAT32. The equipment also has the capacity to record using an ADC and store .wav on the SD card.
There will also be a looping feature, but I dont think that requires extra onboard memory as it can stream directly from the SD-Card

Best Answer

Let's do some math:

16 tracks * 44 ksample/s *2 channels *16 bit = 22.528 Mbps

This is the minimum speed you need for the SPI interface, if you want to transmit all the data through a single serial port. Can be done, with an adequate clock, but you need a fast SD card (see here for the speed).

Then there is the microcontroller: you have to add 16 tracks and output them through a DAC, so you have 44*2 ksamples for each track, or

$$ 44 \cdot 10^{3} \cdot 2 \cdot 16 = 1408 \cdot 10^{3} $$

16-bit sums for every sample (probably with some scaling to avoid overflow) result in about 1.4 M operations/sec, that can be handled by a good 32-bit microcontroller. Probably a Cortex-M3, or better M4 (but M3 is probably better documented) can work for you.

I've just seen this which can be clocked up to 204 MHz, has 4 SPI interfaces, up to 40 MB/s, and has also a floating point unit that can help in the accumulation process (but may be too slow). You may also use the dual core structure to handle separately the processing and the output.

But for the DAC I think that you should go for an external converter, specifically designed for audio (which means 16 bit probably).

Update

It's not so clear how are you going to manage the 16 different tracks on the SD:

  • what about pre-loading tracks on the internal memory of the MCU?

Check the I2S interface, which is a 4-wire serial protocol especially designed for audio applications.

Important question:

You said that you want also to record tracks and save them to the SD card: do you want to do that at the same time? You need the controller to encode the audio in WAV and store it, and the writing bandwith of the SD card is lower.

The looping feature WILL need some buffering memory (may also use the internal memory) because looping requires real time operation, and the SD card will introduce too much latency. You may need an external RAM, and you may also think about storing some data there to reduce delays.

Related Topic