diff --git a/Code-C/main b/Code-C/main index 6d59e32..3cd197e 100755 Binary files a/Code-C/main and b/Code-C/main differ diff --git a/Code-C/main.c b/Code-C/main.c index 1a42c18..32e7fd7 100644 --- a/Code-C/main.c +++ b/Code-C/main.c @@ -9,7 +9,7 @@ #include "getArray.h" bool rawDataWriteFlag; -int nRow = 4; +int nRow = 500; int nCol = 1; double freqEch = 250; diff --git a/Code-C/power.c b/Code-C/power.c index d4714c3..6fd69d1 100644 --- a/Code-C/power.c +++ b/Code-C/power.c @@ -11,15 +11,14 @@ * @param powerArray array where results are stocked */ void powerCalculation(long **p, double powerArray[]){ - printArrayData(p,nRow,nCol); printf("data in pw : \n"); - for(int i = 1; i < nCol; i++){ + for(int i = 0; i < nCol; i++){ int j = 0; powerArray[i] = 0; while(j < nRow){ - printf("%d , %d , %d , %d\n" , p[j][i] ,powerArray[i] , i ,j); - powerArray[i] + pow(p[j][i],2); + printf("\np[%d,%d] = %d\npwArray[%d] = %lf\n" , j,i,p[j][i+1],i,powerArray[i]); + powerArray[i] += pow(p[j][i+1],2); j++; } powerArray[i] /= nRow;