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];
|
2022-05-31 11:33:26 +02:00
|
|
|
for(int i = 0; i < 8; i++){
|
|
|
|
int j = 0;
|
2022-05-31 17:42:26 +02:00
|
|
|
float res = 0;
|
2022-05-31 11:33:26 +02:00
|
|
|
while(1){
|
2022-05-31 17:42:26 +02:00
|
|
|
if(tab[j+1][i]==) break;
|
2022-05-31 11:33:26 +02:00
|
|
|
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
|
|
|
}
|