   sht30.begin();
   PDM.onReceive(onPDMdata);
   PDM.begin(1, 16000);
+
+  // init hann window
+  for (int i = 0; i < HANN_SIZE ; i++) {
+    float sinVal = sin(PI * (i + HANN_SIZE) / (2.0f * HANN_SIZE));
+    hannWindow[i] = sinVal * sinVal;
+  }
+
 }
 
 void loop(void) {

float humidity;
int32_t mic;

extern PDMClass PDM;
short tempBuffer[256];  // buffer to read samples into, each sample is 16-bits
float acc = 0;
float fftBuffer[FFT_SIZE];
uint16_t numInAcc = 0;
volatile int samplesRead; // number of samples read

void setup(void) {

#include <PDM.h>
#include <KickFFT.h>

#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)))

#define LED_PIN 13

