Traitement-signal-plantes/C-Script/power.c

19 lines
448 B
C
Raw Normal View History

2022-05-31 17:42:26 +02:00
#include "power.h"
#include "initialParameters.h"
2022-05-30 18:01:28 +02:00
2022-05-31 17:42:26 +02:00
float power(int tab[nRow][8]){
float periode = 1 /freqEch;
float power[8];
for(int i = 0; i < 8; i++){
int j = 0;
2022-05-31 17:42:26 +02:00
float res = 0;
while(1){
2022-05-31 17:42:26 +02:00
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;
}
2022-05-31 17:42:26 +02:00
return *power;
2022-05-30 18:01:28 +02:00
}