From de00ca7d32f8743a152d0f1974bdbe39fb0c1b04 Mon Sep 17 00:00:00 2001 From: "quentin.perret" Date: Thu, 2 Jun 2022 15:07:04 +0200 Subject: [PATCH] corect error where power col 0 = 0 --- Code-C/power | Bin 17600 -> 17600 bytes Code-C/power.c | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Code-C/power b/Code-C/power index 2fea944fba0d07c1cfa9bdea9531201b37b28835..974d24690ed2ce0f34094d141ebf41981bccbe2f 100755 GIT binary patch delta 535 zcmX@m$#|fXaRUbwNW*j# z4Us?o|Nq1v;d%ln#alD^r+9#Xu?7P}^9x2x*B|^nU;q98KeVF9K(HjZTG7H8DXBC*BnDVJHI-HIClOC_2|{z02B`P z(fsSt{D$Mj;cr004*uP2AbEgolENE74WKUsm>3v3fV2US20B8aol*8aBgjxbfi@;* zUN+`ij6Ccd3^G8W6ri}k}0F7hZEU0{(YjOY+%j6rn9*iZM74`U8 zfRv%pea%KS3YsftS delta 509 zcmX@m$#|fXaRUb>$dvakHWz3mY3FQ18o>$=c%ToF9SAZr2|kGbV2km(V!)fXRdLLN`Mi z|NBdy__Z#idGOa=_{1;3`T=N68o$N~pg`V%7n>%}7uTG8MqE;6K8kqakN^Ka@kh9x z0BYfFnan5=z-z6+z|j1H(bDw?f6w2^aT0d*U(^{GEM5Qb_w@ez|9`@SlZQh+I-hzp zze(tQ1q>j@y)d9CyK4vhyW7EE}(%dlW*vHFs5u) z)Z=FXQiewVnHUo$8=BTLUYWen)E+4G(bS)jkzul<`Etgkn_rrL=U_~n{Ln$4Ger_; MHpuwRl8(!n0WR^rwg3PC diff --git a/Code-C/power.c b/Code-C/power.c index 78021db..0eff51c 100644 --- a/Code-C/power.c +++ b/Code-C/power.c @@ -11,16 +11,17 @@ void power(int **p, double a[]){ printf("temps : %f\n",temps);*/ //Fill array with the power of the signal for each captor - for(int i = 1; i < nCol; i++){ + for(int i = 0; i < nCol-1; i++){ int j = 0; a[i] = 0; while(j < nRow-1){ - double aire = ( pow(p[j][i],2) + pow(p[j+1][i],2) ) / 2 * periode; + double aire = ( pow(p[j][i+1],2) + pow(p[j+1][i+1],2) ) / 2 * periode; //printf("aire [%d,%d] : %f\n",j,i,aire); a[i] += aire; j++; } a[i] *= temps; + //printf("%f\n", a[i]); } } int main(int argc , char** argv){