 //#define FFT_SIZE 512
 //#define HANN_SIZE 60
 
-#define ACC_SIZE 128
+#define LOW_PASS_SIZE 64 // 250Hz sample freq, this means signals above 125Hz are filtered
+#define ACC_SIZE 2 // reduce sample rate before doing fft for performance reasons
 #define FFT_SIZE 256
-#define HANN_SIZE 30
+#define HANN_SIZE 40
 #define FS (16000.0 / ACC_SIZE)
 #define F2 3.5f
 #define END_INDEX ((uint16_t) (F2 / (FS / FFT_SIZE)))

    uint32_t start = micros();
    for (int i = 0; i < samplesRead; i++) {
      float newVal = tempBuffer[i];
      //acc += newVal * newVal;
      acc += newVal;
      numInAcc++;
      if (numInAcc >= ACC_SIZE) {
          float value = acc / ACC_SIZE;
          acc = 0;
          numInAcc = 0;
          addToFFT(value);
          // addToFFT(value);
      }

      //samples--;
    }
    // clear the read count
    uint32_t duration = micros() - start;
    //Serial.print("micros: "); Serial.println(duration);
    //Serial.print("samples: "); Serial.println(samplesRead);


}

void onPDMdata() {
  if (samplesRead) {
    Serial.println("PDM data did not get processed");
  }

  // query the number of bytes available
  int bytesAvailable = PDM.available();

