power check ok

This commit is contained in:
quentin.perret 2022-06-02 13:57:01 +02:00
parent 4bf0dfc70d
commit b904f19500
3 changed files with 800029 additions and 800034 deletions

View file

@ -1,3 +1,3 @@
#include <math.h>
//double *power(int **p);
void *power(int **p, double a[]);

File diff suppressed because it is too large Load diff

View file

@ -1,39 +1,34 @@
import math
import numpy as np
# import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import csv
#"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT"
#! /usr/bin/env python3
# -*- coding: UTF-8 -*-
taille = 100000
freq = 250
periode = 1 / freq
temps = periode * taille
resultat = np.zeros(taille)
i = 0
resultat = np.zeros([taille,8])
j = 0
# opening the CSV file
with open('rawData.csv', mode ='r') as file:
# reading the CSV file
csvFile = csv.DictReader(file)
csvFile = csv.reader(file, delimiter=",")
# displaying the contents of the CSV file
for lines in csvFile:
resultat[i] = lines
print(lines)
i+=1
"""
line = np.zeros(8)
for i in range(8):
line[i] = lines[i+1]
resultat[j] = line
j+=1
if(j == taille) : break
#print(resultat.shape)
resultat*=resultat
aire = 0
for i in range(taille-1):
aire += (resultat[i]+resultat[i+1]) / 2 * periode
res = aire/temps
print(res)"""
for i in range(8):
aire = 0
for j in range(taille-1):
aire += (resultat[j,i]+resultat[j+1,i]) / 2 * periode
res = aire/temps
print("power c°" + str(i+1) + " : " + str(res))