 String data;
 
 int sampling_freq_hz = 200;
+int down_sampling_rate = 20;
+int down_sampling_counter = 0;
 int millisecond_delay = 16; //This should be the same as 1000 / 200;
 int microsecond_delay = millisecond_delay * 1000;
-//int sampling_period_ms = 1000 / sampling_freq_hz;
+
+// Define various ADC prescalers
+//Initialization flags
+const unsigned char PS_2_i = 0xe1;
+const unsigned char PS_4_i = 0xe2;
+const unsigned char PS_8_i = 0xe3;
+const unsigned char PS_16_i = 0xe4;
+const unsigned char PS_32_i = 0xe5; //Chosen Prescaler
+const unsigned char PS_64_i = 0xe6;
+const unsigned char PS_128_i = 0xe7;
+
+//Code flags -> should use the same prescaler as the initialization
+const unsigned char PS_2_c = 0xf1;
+const unsigned char PS_4_c = 0xf2;
+const unsigned char PS_8_c = 0xf3;
+const unsigned char PS_16_c = 0xf4;
+const unsigned char PS_32_c = 0xf5; // Chosen Prescaler
+const unsigned char PS_64_c = 0xf6;
+const unsigned char PS_128_c = 0xf7;
 
 void setup() {
     // declare the ledPin as an OUTPUT:

  digitalWrite(digitalSelectPin, HIGH); //Set to HIGH for 6G sensitivity, OR LOW for 1.5G sensitivity
  digitalWrite(digitalSleepPin, HIGH);
  Serial.begin(115200); // use the serial port
  TIMSK0 = 0; // turn off timer0 for lower jitter - delay() and millis() killed
  ADCSRA = 0xe7; // set the adc to free running mode // This is the default -> 229 or 0xe5
  ADMUX = 0x40; // use adc0
  DIDR0 = 0x01; // turn off the digital input for adc0
}


// do #defines BEFORE #includes
#define LOG_OUT 1 // use the log output function
#define FFT_N 256 // set to 256 point fft
#define WINDOW 1 // Enable windowing

#include <FFT.h> // include the library
//#include <prescaler.h>
