Hi
First of all, I would like to thank you for great support in my previous thread.
I am trying to implement c code to Arduino IDE, the problem is with serial monitor, it does not shows anything.

Does anyone see the mistake ?

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define PI 3.141592653589793
#define SAMPLING_RATE 8000.0 //8kHz
#define TARGET_FREQUENCY 941.0 //941 Hz
#define N 205 //Block size
int sigPin = 0;
float n = 128.0;
int testData[128];
double A1;
double U1;
double U2;
double U0;
double SA0;
double CA0;
double omega;
double step;
double amplitude;
double phasein;
double phaseout;
double sig[N];
double real;
double imag;
//int index;
void setup()
{
/*
// 8000 is the sampling frequency
// 941 is the tone frequency
omega = 2.0 * PI * 941.0 / 8000.0;
CA0 = cos(omega);
SA0 = sin(omega);
// A1 = (double) 2.0 * CA0;
U1 = 0.0;
U2 = U1;
step = 941 * (2.0 * PI) / 8000.0;
phasein = PI / 4.0;
*/
Serial.begin(115200);
}
void loop() {
////////////////////////
for (char index = 0; index < n; index++)
for (index = 0; index < N; index++)
{
testData[index] = analogRead(sigPin);
}
//////////////////////
for (char index = 0; index < n; index++)
// for (index = 0; index < N; index++)
{
sig[index] = 100.0 * sin(index * step + phasein);
U0 = sig[index] + A1 * U1 - U2;
U2 = U1;
U1 = U0;
}
//and iterate over that signal, I end up with the Goertzel
real = U1 - U2 * CA0;
imag = U2 * SA0;
amplitude = (2.0 / (double)N) * sqrt(real * real + imag * imag);
phaseout = atan2(imag, real);
Serial.println();
Serial.print(amplitude);
// return 0;
}