 #define FFT_SIZE 512
 #define HANN_SIZE 40
 #define FS (16000.0 / ACC_SIZE)
-#define F2 4.0f
+#define F2 3.5f
 #define END_INDEX ((uint16_t) (F2 / (FS / FFT_SIZE)))
 
 #define LED_PIN 13

uint16_t _old_max_index = 0;
float phaseAvg[END_INDEX];
float phaseRateAverage[END_INDEX];

void updatePhase(const float mag[], const float phases[], uint16_t startIndex, uint16_t endIndex) {
    float maxValue = -1000;
    uint16_t maxIndex = startIndex;
    for (int i = startIndex; i < endIndex; i++) {
        if (i <= 0) {
          continue;
        }
        float val = mag[i];
        if (val > maxValue) {
            maxValue = val;
            maxIndex = i;
        }


    //}

    _old_max_index = maxIndex;
    return ret;
}


