/* * afsk_demodulator.c * * Created on: Sep 10, 2019 * Author: curiousmuch */ #include "stdio.h" #include "stdint.h" #include "math.h" #include "afsk_demodulator.h" int8_t window[WINDOW_SIZE]; //int32_t lpf_window[WINDOW_SIZE]; double goertzelFilter(int8_t samples[], double freq, unsigned int N) { double s_prev = 0.0; double s_prev2 = 0.0; double coeff,normalizedfreq,power,s; unsigned int i; normalizedfreq = freq / SAMPLEFREQUENCY; coeff = 2*cos(2*M_PI*normalizedfreq); for (i=0; i