Go Down

Topic: Re: Arduino Realtime Audio Processing (Read 3677 times) previous topic - next topic

alex5678

Jul 24, 2019, 08:46 pm Last Edit: Jul 24, 2019, 08:47 pm by alex5678
Hello, I want to do some serious audio processing with Arduino DUE. How better performance can I get with an external hardware A/D with more than 10 bits? What is the best resolution + sampling I can achieve? With which hardware A/D? In previous post in this thread I have read that external hardware communicates with Arduino through SPI. Any suggestion is appreciated. Thank you...

CrossRoads

#1
Jul 24, 2019, 09:06 pm Last Edit: Jul 24, 2019, 09:07 pm by CrossRoads
You can use external SPI ADC such as AD5662 DAC and AD7680 ADC with 4.5V Reference such REF194.

More details and a schematic for one channel of sampling to SD card and playback  using 16 MHz 8-bit processor here

https://forum.arduino.cc/index.php?topic=180769.0

(forum adds some extra characters at the front, I can't seem to clean it up)
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DVDdoug

I really don't know, but I'd assume you can read & write digital data at any "normal" audio resolution  (i.e. higher resolution than "CD quality".)

Any limitations you may run-into are likely to be related to whatever audio processing you're doing.  But, you may need to write some assembly language.    I haven't used the Due, but the Uno seems  "slow" running a loop running in C++.

You can probably do simple processing (maybe changing the volume) with high resolution digital audio (higher than "CD quality").

alex5678

#3
Jul 24, 2019, 10:07 pm Last Edit: Jul 24, 2019, 10:32 pm by alex5678
You can use external SPI ADC such as AD5662 DAC and AD7680 ADC with 4.5V Reference such REF194.

More details and a schematic for one channel of sampling to SD card and playback  using 16 MHz 8-bit processor here

https://forum.arduino.cc/index.php?topic=180769.0

(forum adds some extra characters at the front, I can't seem to clean it up)
Thank you. Because the circuits you suggest are SMDs and I cannot solder them, I used the characteristics you gave and a DIP I have found is this:

https://uk.farnell.com/analog-devices/ad977bnz/adc-16bit-100ksps-dip-20/dp/2462278?st=Analog%20to%20Digital%20converter%20100%20ksps%2016%20bit%20spi

Can I use it?

Also for the DAC I cannot find any DIP with this characteristics. Can I use something else instead? Also, can a ~80MHz CPU like Arduino's DUE handle 100 KSPS? Does SPI help to transfer those data quickly?

Can these do something better, and achieve CD-quality?

http://ww1.microchip.com/downloads/en/devicedoc/20002249b.pdf
http://www.farnell.com/datasheets/1669397.pdf

Thank you


Grumpy_Mike

Quote
Does SPI help to transfer those data quickly?
Yes.

Quote
can I use https://uk.farnell.com/analog-devices/ad977bnz/adc-16bit-100ksps-dip-20/dp/2462278?st=Analog%20to%20Digital%20converter%20100%20ksps%2016%20bit%20spi
Yes but the Link says it is now no longer stocked.

Your final throughput or sample rate will depend on what sort of signal processing you want to do. Is this digital filtering?


alex5678

Yes.
Yes but the Link says it is now no longer stocked.

Your final throughput or sample rate will depend on what sort of signal processing you want to do. Is this digital filtering?
I want to input sound and do some special effects with that. Bass, echo and things like this....

ard_newbie

If you are looking for sound distortion effects, what's the use of external ADC and DAC rather than the on board 12-bit ADC and DACs ?

https://forum.arduino.cc/index.php?topic=596875.0

alex5678

#8
Jul 25, 2019, 10:22 am Last Edit: Jul 25, 2019, 10:22 am by alex5678
If you are looking for sound distortion effects, what's the use of external ADC and DAC rather than the on board 12-bit ADC and DACs ?

https://forum.arduino.cc/index.php?topic=596875.0

Don't I achieve better quality with more bits resolution?

ard_newbie

#9
Jul 25, 2019, 10:25 am Last Edit: Jul 25, 2019, 10:29 am by ard_newbie
What better quality ???? you are going to distort the input sound, IMO you won't be able to ear much difference between a 12-bit and a 16-bit distorted sound (far from a symphonic music).


https://www.electrosmash.com/pedalshield


alex5678

#10
Jul 25, 2019, 10:29 am Last Edit: Jul 25, 2019, 04:17 pm by alex5678
My fault. Sound including voice... As I see more carefully, Arduino DUE has 12-bit ADC and 12-bit DAC so I believe that's enough for real time sound processing. I was thinking going to 13-bit SPI ADC and DAC DIP modules I described in previous posts. But 1bit more won't make something more accurate to CD-quality, right?

Grumpy_Mike

Quote
But 1bit more won't make something more accurate to CD-quality, right?
Well right it is closer but you will be hard pushed to it to here the difference.

It is a matter of diminishing returns rather the same as a video display more pixels means a better quality picture but each time you double the resolution the increase in quality gets smaller and smaller until it is hardly noticeable.

Just use what you have onboard and see what sort of sample throughput you can get. There are tricks to make the internal A/D run faster by altering the clock pre-scaling registers.

I have done this sort of thing on a Uno with extra memory chips and an external D/A. You will find it in my book, but the software is online to download as well. Delay, echo, multiple echo, pitch doubling pitch halving and even sort of real time backwards speaking.
http://www.apress.com/9781484217207

PieterP

When it comes to audio processing with Arduino, nothing beats PJRC's Teensy boards.

Just combine them with an I2S ADC+DAC. You can even get them as a shield for the Teensies.

There's also a graphical audio design tool available.

Except for educational purposes, I don't think trying to program everything yourself is a good idea.
Audio is hard, because all processing has to happen on time, and setting up the necessary DMA controllers is not easy either.

Even if you decide to use the Arduino Due, using an existing I2S audio libraries is probably going to be easier than trying to implement it yourself using SPI DACs.
I2S is designed specifically for audio, SPI is not.

Pieter

alex5678

#13
Jul 25, 2019, 08:46 pm Last Edit: Jul 25, 2019, 08:48 pm by alex5678
I am reading a lot of things about this in this forum. What I want to ask is if I take this circuit here:

http://interface.khm.de/index.php/lab/interfaces-advanced/arduino-realtime-audio-processing/

and instead of connecting the output on PWM, I connect it to the DAC of the DUE, will it work? Will I take sound on the output?

Also this here:

https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer

What modifications should I do to play sound from Arduino DUE's memory and not from the SD card?

Thank you

@PieterP: Ok, I will look at it, I didn't know that.

MarkT

Hello, I want to do some serious audio processing with Arduino DUE. How better performance can I get with an external hardware A/D with more than 10 bits? What is the best resolution + sampling I can achieve? With which hardware A/D? In previous post in this thread I have read that external hardware communicates with Arduino through SPI. Any suggestion is appreciated. Thank you...
Does anyone know is there's library support for I2S on the Due?  The https://www.arduino.cc/en/Reference/I2S library seems not to include it...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up