Feasibility: Microphone, Speaker, WiFi - Required processor speed

Hi,

I'm looking at doing something rather simple, but I'm not sure the processor speed will be enough.

Here is what I want to do:

  1. Record sound (sentences, not too long, maybe 5 seconds max) - I would like to stream this to the server
  2. Send this via WiFi to a server for processing
  3. Server streams the result back via WiFi to be played back (max 10 seconds) - As soon as the resulting audio is received it should be played, like streaming audio, 128kb/s quality wav.

The hardware I am looking at is the following:

Main board:
Arduino + WiFi Integrated
http://robotics.org.za/index.php?route=product/product&path=150_156&product_id=571

Microphone:
Breakout, Microphone Electret
http://robotics.org.za/index.php?route=product/product&path=138_186&product_id=445

Speaker:
Standard speaker.

Now to the question, the main board I am looking at has a ATmega328P http://www.atmel.com/devices/atmega328p.aspx processor that runs at max 20 Mhz. Will 20 Mhz be enough to do what I want without the playback (to the server/from the server) stuttering, assuming no network problems?

Thank you in advance,

Donovan

  1. Record sound (sentences, not too long, maybe 5 seconds max)

Audio quality sound sampling is not something the Arduino is good at.

I would like to stream this to the server

That will really slow down the rate at which you can sample data. To the point where "forget it" rears it's ugly head.

Thanks!

  1. The quality of the audio is not of great importance, I can filter is a bit on the server side, but it needs to be good enough to be able to push through voice recognition (speech-to-text)..

That will really slow down the rate at which you can sample data. To the point where "forget it" rears it's ugly head.

That is also fine, streaming would be the very best, but I have no problem dropping it and only send the audio after 5 seconds (or some other 'cutoff' parameter)

My other main board option is
Arduino Due
http://robotics.org.za/index.php?route=product/product&path=47_147&product_id=604

It doesn't have WiFi built in, but has a clock speed of 84 Mhz...

There is a tradeoff. Higher sample rates will produce better sounding data. But, you have more data to store, and a limited amount of space to store the data in.

The higher speed DUE would be a better choice, since it also has a lot more SRAM where you would store the sampled data prior to sending it.

128kb per second for 5 seconds is 640k of data. You'll be really hard-pressed to store that in the 2k or SRAM that the 328-based Arduinos have.

donovansolms:

  1. The quality of the audio is not of great importance, I can filter is a bit on the server side, but it needs to be good enough to be able to push through voice recognition (speech-to-text)..

If you want to be able to do speech-to-text then the quality is vitally important. I'm pretty sure that the sampling rate and resolution available from an Arduino will render the speech incomprehensible to any readily available speech recognition software. You might be better off starting with a computer with the processing power to do the voice recognition locally, rather than trying to use an Arduino as a wireless microphone and process the audio remotely.

The higher speed DUE would be a better choice, since it also has a lot more SRAM where you would store the sampled data prior to sending it.

Agreed. I was hoping to skip the 'add-wifi-shield' step..

You might be better off starting with a computer with the processing power to do the voice recognition locally

I was hoping that won't be the end result, but I agree, maybe test the whole system concept first before adding this feature.

Thank for the quick input!

You need to read the FFT reference in the Library page. I don't know what your Math experience is but its better to understand the background to Fourier transforms before you start doing signal processing. Makes the whole concept much more rewarding.
As someone (sorry, it was you in fact) commented about using the Due, thats exactly the reason why I've just bought some for development. There are a couple of chinese ebayers selling Due boards for a lower price.

read the FFT reference in the Library page

Thanks! That is the type of resource I was looking for, but had no idea what to search for! Seems that the Due will be my choice to develop with.

The URLs I found if someone else want to check it out:
FFT ArduinoFFT - Open Music Labs Wiki
FHT ArduinoFHT - Open Music Labs Wiki

I'm glad you found that useful.
OML has a great reference on his page to www.alwayslearn.com ; this guy's explanation is something I wish I had access to when I was studing the math in Fourier transforms years ago.
Again, not trying to teach you how to suck eggs, but if you have'nt used dspguru, there is a wealth of knowledge on that site..just google it.