     if (fft_log_out[i] > noise_floor &&
         fft_log_out[i] >= fft_log_out[i-1] &&
         fft_log_out[i] >= fft_log_out[i+1]){
-          int j=i;          
+          int j=i;
+
+          //Determine the BW of the peak
           while(fft_log_out[j] > fft_log_out[i]/2){
             if(j>=FFT_N/2-1){
               break;
             }
             j++;
           }
-//         dB3[i] = 2*(j-i-1)+1; //Algorithm to find the 3dB point
-        dB3[i] = fft_log_out[i]*(2*(j-i-1)+1); //This actually find the power
+
+          
+//         dB3[i] = 2*(j-i-1)+1; //Algorithm to find the right hand 3dB point
+        peak_power[i] = fft_log_out[i]*(2*(j-i-1)+1); //Calculate the power of this peak
     }
   }
   


//peak finding variables
const int number_of_peaks = 5;
const int noise_floor = 50;
int biggest_peaks[number_of_peaks];
int dB3[FFT_N/2];

//State Data
boolean is_microphone = true;
int down_sampling_rate = 5;

void setup() {
    // declare the ledPin as an OUTPUT:

Code developed by Sensorica
Modified from openmusiclabs.com 8.18.12 example sketch 

We sample microphone and vibration sensor data and alternates between the two
We pass the data through an FFT
We searche for peaks in the FFT
We calculate the 3dB peak-power at the peaks
We output the data to the serial port
*/

// do #defines BEFORE #includes
