Traitement-signal-plantes/C-Script/power.c
2022-05-31 17:42:26 +02:00

19 lines
448 B
C

#include "power.h"
#include "initialParameters.h"
float power(int tab[nRow][8]){
float periode = 1 /freqEch;
float power[8];
for(int i = 0; i < 8; i++){
int j = 0;
float res = 0;
while(1){
if(tab[j+1][i]==) break;
float aire = ( pow(tab[j][i],2) + pow(tab[j+1][i],2) ) / 2 * periode;
res += aire;
j++;
}
power[i] = res;
}
return *power;
}