     }
     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;
-          //minwave = min(value, minwave);
-          //maxwave = max(value, maxwave);
-          addToFFT(value);
+          addToFFT(value * value);
+          // addToFFT(value);
       }
-      // minwave = min(tempBuffer[i], minwave);
-      // maxwave = max(tempBuffer[i], maxwave);
 
       //samples--;
     }


#define ACC_SIZE 64
#define FFT_SIZE 512
#define HANN_SIZE 20
#define FS (16000.0 / ACC_SIZE)
#define F2 4.0f
#define END_INDEX ((uint16_t) (F2 / (FS / FFT_SIZE)))

  sht30.begin();
  PDM.onReceive(onPDMdata);
  PDM.begin(1, 16000);
  PDM.setGain(5);

  // init hann window
  for (int i = 0; i < HANN_SIZE ; i++) {
