Audio processing with arduino

Hi everybody,

I'm a beginner with arduino and I need some (a lot) help on a project i'm working on:
I think about creating a realtime audio processing device with arduino connected to speaker (I have 3ohms/55W speaker).
It shall be able to analyse a simple sound (for example: if somebody plays a music note) and instantaneously play the same sound wave on the speaker. (like a singer in a concert, speakers reproduce the music played by the singer).

Here is some questions i'm wondering:

  1. I would like to know if arduino is able to do that?
  2. What kind of device shall i need (Microphone, amplifier)
    I found that:
    Electret Microphone - COM-08635 - SparkFun Electronics
    http://www.sparkfun.com/products/8872
  3. Is it possible to output a soundwave (sinusoïdal signal) from arduino to the speaker with positive and negative voltage value?

I plan to buy the necessary material for that project, could you help me to choose the right one.
Thank you in advance for your help

I would like to know if arduino is able to do that?

Just about but not very well.

What kind of device shall i need (Microphone, amplifier)

Yes both those.

See this site for what can be done:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

Is it possible to output a soundwave (sinusoïdal signal) from arduino to the speaker with positive and negative voltage value?

Not without external hardware.

Thank you a lot for you answer Grumpy_Mike,
The link is close to what I'm trying to do, but i'll need some explanation on it, first:

Extracted from the site:
"DC Offset

A natural audiosignal consists of positive and negative waveparts which is leading to an electrical AC audiosignal. Since the Analog to digitalconverter on the Arduino can measure only positive voltages a constant offset has to be added to the signal. This is done with a resistor divider we see in our schematic. With the trimmpot the DC offset has to be adjusted to a value of 127. When doing the audio calculations this offset has to be subtracted first and when the result is calculated to be added again."

Does this means that if I adjust the DC offset to 127, when the analog output value is lower to 127, the speaker receives an negative voltage?
If it is true could you tell me how to change this parameter?

You said that it isn't possible without an external hardware, what kind of hardware shall I need?

Secondly, about the microphone and the amplifier, do know where could I find a tutorial or an example of program which could be applied tu use for the amplifier?

Finally, I have to idea how to define what kind of hardware (resistor's value, capcitor's value) has to be connected between analog ouput and my speaker to be compatible with the speaker's caracteristics (3ohms,55Watts)

Something tells me this is a slightly bigger project than you think... And, you might not get the audio quality you are looking for without adding external ADCs & DACs...

Does this means that if I adjust the DC offset to 127, when the analog output value is lower to 127, the speaker receives an negative voltage?
If it is true could you tell me how to change this parameter?

I haven't studied that project and I'm not sure what they are trying to say...

But, the Arduino analog-to-digital converter reads from 0-1023. So with the internal reference set to 5V, you will read ~511 (not 127) with 2.5V applied. With silence (and the 2.5V offset), you will read ~511. If you apply an AC audio signal, your A/D reading will be less than 511 when the signal swings negative, and greater than 511 when the signal swings positive.

By subtracting 511 in software (in your sketch), you can take-out the offset.

Secondly, about the microphone and the amplifier, do know where could I find a tutorial or an example of program which could be applied to use for the amplifier?

Are you going to build an amplifier, or buy an amplifier?

You need a preamplifier to boost a microphone-level signal to (approximately) line-level for the Arduino (or for a hi-fi amp, etc.). If you want to build an amplifier, [u]National Semiconductor[/u] makes lots of audio chips and they have "application notes" with suggested schematics.

If you want to buy something, a [u]small mixer[/u] is usually cheaper than a separate preamp. (Make sure to get a mixer with a microphone input).

Finally, I have to idea how to define what kind of hardware (resistor's value, capcitor's value) has to be connected between analog ouput and my speaker to be compatible with the speaker's caracteristics (3ohms,55Watts)

You cannot drive a speaker directly from the Arduino. You need a power amplifier to drive a speaker. The wattage rating on the speaker is it's maximum rating, and you may not need 55W.

Again, if you want to build a power amp, National Semiconductor is a good starting-point. Or, you can buy a [u]small power amplifier[/u].

what kind of hardware (resistor's value, capcitor's value) has to be connected between analog ouput and my speaker to be compatible with the speaker's caracteristics (3ohms,55Watts)

There is no analogue output on an arduino.
There is a PWM digital output:-
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
But the normal PWM frequency is not high enough for audio, so you will have to mess about changing the frequency. Then you will need not only an amplifier but a restoration filter.

There is very little memory available for audio processing, so things like a delay are in the order of a fraction of a second, eho is right out. There is not much processing power so things that use a lot of computation are also right out.