Pages: [1]   Go Down
Author Topic: Frequency Analysis/Saving Audio to SD card from Mic  (Read 1159 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
Code:
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.
« Last Edit: April 03, 2013, 12:44:02 pm by dai3504 » Logged

Offline Offline
Edison Member
*
Karma: 50
Posts: 1702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Montreal
Offline Offline
Faraday Member
**
Karma: 31
Posts: 2611
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Pages: [1]   Go Up
Jump to: