Recording and Analyze

Recording and Analyze

Postby asmadi » Sun Feb 19, 2012 4:03 am

Hi guys,

I want to doing a simple project to record the sound and analyze it with a simple formula (x*x). Where x is equal a realtime sound. I'm just MOD the board to suite using with microphone. I open the 'microphone.pde' and try it and success!. Only, the code for record the sound and pass data through. Just, somebody have some idea how I want to start to analyzed the sound without pass data through?

My requirement:

Sampling Freq = 22050Hz (16-bit)
Frame size or maybe buffer size= 1024 (this frame size for analyze using a simple formula, x*x)

so for 1 seconds i will have 22050 data point and approximately 21 frame (22050/1024 = 21.5).

I hope i will get some idea to try.. ;) Thank You
Posts: 1
Joined: Tue Feb 14, 2012 12:00 pm

Re: Recording and Analyze

Postby guest » Sun Feb 19, 2012 12:14 pm

to create a buffer in memory
take a look at the exmple fixed_delay

Code: Select all
// create a delay buffer in memory
#define SIZE 800 // buffer size is limited by microcontroller SRAM size
int delaymem[SIZE]; // 800 positions x 2 bytes = 1600 bytes of SRAM
unsigned int location = 0; // buffer location to read/write from

there is a limit to the size of memory in the arduino
about 800 samples is the max

then you increment the sample counter in the ISR routine

to change to 22ksps you can do the following at the top
Code: Select all
#define SAMPLE_RATE 22 // 22.05Khz
Site Admin
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 0 guests