analogue sound processing

Hello everybody, could you tell me how analogic signal are treated by A.? I mean: is an analogic input converted into digital signal and then processed or there's a way to treat it directly as an analogjc signal ? Thanks a lot

If you’re looking to “process” sound, you’re likely looking at the wrong platform. Processing audio signals is memory intensive. Arduinos are not well endowed with memory.

I'd Like to make somethig like gate: i get the input from an assigned analogic input pin, and the sketch send the same signal to one output pin if it lower then a fixed treshold, or to one another output pin if higher. but if A. convert the input from analogic to digital I'd probably have a big lost of sound quality due to the bad features of A. ADC...

Hi Davide,

the signal goes through an ADC therefore, you can read values 0 - 1023 which map the 0-5V, I am not so expert to tell you how the audio quality is, by the way the sampling ratio on an Arduino Uno is maximun the half of the CPU frequency (16Mhz) therefore 8Mhz, not that bad but I am afraid our applications can not simply follow that piece.

I suggest you to have a look at the Micro documentation, let me know if you find some lights in this area, I am intested too !

Ciao, Pietro

Well … I could have been wrong, a CD-ROM sample rate should be 44100 (44,1Mhz) therefore 8Mhz theoretical is just … bad, can someone confirm us that ?

pedr0: Well .. I could have been wrong, a CD-ROM sample rate should be 44100 (44,1Mhz) therefore 8Mhz theoretical is just ... bad, can someone confirm us that ?

You are mixing up KHz and MHz. 8 KHz sounds fine for speech.

by the way the sampling ratio on an Arduino Uno is maximun the half of the CPU frequency (16Mhz) therefore 8Mhz,

That is just rubbish.

You are mixing up KHz and MHz. 8 KHz sounds fine for speech.

You right it is 44.1 Khz

That is just rubbish.

Following that link and having a look to the ATMEL doc I come to that conclusion, I am trying to understand too ..

Could you explain yourself MUCH better than you just did ?

http://www.microsmart.co.za/technical/2014/03/01/advanced-arduino-adc/

Could you explain yourself MUCH better than you just did ?

Your statement that:-

he sampling ratio on an Arduino Uno is maximun the half of the CPU frequency (16Mhz) therefore 8Mhz,

Is pure and utter drivel, it is wrong, it is incorrect, it shows a total misunderstanding of the topic, it shows no understanding of processors and how they work. It makes no sense, it is bereft of logic, it rests in peace. It is a random collection of concepts that are not coherent. I am at a loss as to how you could come to that conclusion by reading the link you posted. It is illogical, it is RUBBISH.

There is that clearer?

excuse me guys, i'm gonna go back to my original question: the documentation about the analogRead() function talks about a 10 bit resolution and a 10,000 Hz sample rate; for the Nyquist theorem, it means a low-pass filter with a cut-off frequency of about 5 kHz, that could be good enough for speech but absolutely unsufficient for music. This way my gate wouldn't work the way i'd like... or am I wrong? Is there some way to deal with analog inputs other than the analogRead() function? Thanks!

but absolutely unsufficient for music.

Try it, it is better than you think. The cut off frequency is only the point where the filter starts to roll off, you still get stuff beyond that. However by altering the prescaler you can easily exceed 20KHz sampling rate. The quality limiting factor is your D/A, you need an external one, then it comes down to the sample resolution ( only 10 bits on internal A/D ) and finally, third on the list is the sample rate if it is over 20K.

Is there some way to deal with analog inputs other than the analogRead() function?

Yes use an external A/D chip.

thanks Mike! do you know a simple way to use the PC soundcard as A/D sending digital input to Arduino? and a way to use it back as a D/A?

I would not have thought that was possible, sorry.

Grumpy_Mike: 8 KHz sounds fine for speech.

I have to back Grumpy_Mike on this. It's actually the default bandwidth allocated to mobile voice calls. Not great for listening to a concert but good enough to carry out a conversation.

Grumpy_Mike:

Could you explain yourself MUCH better than you just did ?

Your statement that:-

he sampling ratio on an Arduino Uno is maximun the half of the CPU frequency (16Mhz)
therefore 8Mhz,

Is pure and utter drivel, it is wrong, it is incorrect, it shows a total misunderstanding of the topic, it shows no understanding of processors and how they work. It makes no sense, it is bereft of logic, it rests in peace. It is a random collection of concepts that are not coherent.
I am at a loss as to how you could come to that conclusion by reading the link you posted.
It is illogical, it is RUBBISH.

There is that clearer?

Puah !

Sorry to interject. if you’re sampling at 10kHz you’re NOT getting anything
beyond 5kHz actually. The Nyquist theorem has a < (strictly lower) fs/2 not
a <=.

What does that mean?

if there are frequencies abover Fs/2 samples, they are undistinguishable
from frequencies at Fs-Fs/2… and Fs and DC are ‘in the same bin’ if you’re
talking FFT.

In the digital world, the frequency becomes periodic. So make sure to filter
your analog signal appropriately BEFORE the ADC.

But the Arduino is definitely not the suited for music, barely for speech.

hope that helps a bit

Yves

Grumpy_Mike:

but absolutely unsufficient for music.

Try it, it is better than you think. The cut off frequency is only the point where the filter starts to roll off, you still get stuff beyond that.
However by altering the prescaler you can easily exceed 20KHz sampling rate. The quality limiting factor is your D/A, you need an external one, then it comes down to the sample resolution ( only 10 bits on internal A/D ) and finally, third on the list is the sample rate if it is over 20K.

Is there some way to deal with analog inputs other than the analogRead() function?

Yes use an external A/D chip.