hello, the original code contains a serie of mistake :
- its 360 and not 370 so you should have :
corr[N]*cos(2*N*PI/period);
corr[N]*sin(2*N*PI/period);
-for (period = 3; period < HighCutoff; period++)
{
pwr[period] = R[0][period] / maxPwr[0];
}
here R[0][period] has been calculated only from period = LowCutOff and not for the values between 3 and LowCutOff-1
-also you are calculating on 39 terms (48-10+1) in many of your loops whereas your arrays can contain only 38 values
-I can see other index problems in your arrays exceeding their initial dimensions

Last edited by byakuren81; 11/20/14 16:25.