Frequency Analysis/Saving Audio to SD card from Mic

Hello, I am currently doing a project where I would like to analyze the frequency of the sound of a chain dragging across concrete.

I have this component: http://www.freetronics.com/products/microphone-sound-input-module#.UVxXmKKceSo

connected to an Arduino Duemilanove w/ ATMega 328.

It says it can output Sound Pressure Level (which I am assuming is loudness [dB]) and the raw audio waveform.

When I run an analog read on the MTC output in DEC with this code:

const int micSensor = A0;   // the SPL output is connected to analog pin 0

void setup() {
 Serial.begin(38400);
}

void loop() {
  Serial.println(analogRead(micSensor), DEC);
  delay(10);  // delay to avoid overloading the serial port buffer
}

I am getting numbers such as this:

331
379
369
351
359
347
352
370
319
401
324
343
409
378
351
340
339
384
350
336
393
331
348
360
313
348
334
360
368
317
385
343
320
386
322
374
330
319
344
317
334
360
310
381
342
322
363
313
334
346
317
356
313
312
390
318
347
320
344
359
333
311
382
293
327
345

I wondering if anyone can guide me in trying to save the output of this device to an audio file to an SD card so I can perform further analysis with a program called Audacity (http://audacity.sourceforge.net/). Or if you know of any methods/libraries to get the output in the serial monitor in Hz.

I already have an SD Card module that I have interfaced with the arduino and have successfully been able to read/write to a text file.

Thanks! Please ask if you need clarification.

You are sampling the audio at 100Hz which is nowhere near sufficient for the output from that device which goes up to 15kHz. To produce data that would be worth analyzing you would have to sample the audio at at least 30kHz. Apparently, the best that the Arduino can do is around 10kHz which is only good for audio up to about 5kHz.

Pete

It is no problem to sample at 40khz with Arduino. Average every 2 sample gives you a high cutoff filter.

100 ksps reported: http://arduino.cc/forum/index.php/topic,118073.0/topicseen.html
Though it's not clear for me why some one would need to analyze chain sound, but you may try to process data w/o saving them, real-time:
http://coolarduino.wordpress.com/2012/10/18/speech-voice-recognition-remix/