Traitement-signal-plantes/Py-Script/puissance.py

39 lines
713 B
Python
Raw Normal View History

2022-03-18 14:29:49 +01:00
import math
import numpy as np
2022-03-24 15:39:51 +01:00
# import matplotlib.pyplot as plt
import csv
2022-03-18 14:29:49 +01:00
#"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT"
#! /usr/bin/env python3
# -*- coding: UTF-8 -*-
taille = 100000
freq = 250
2022-03-18 14:29:49 +01:00
periode = 1 / freq
temps = periode * taille
resultat = np.zeros(taille)
i = 0
# opening the CSV file
with open('rawData.csv', mode ='r') as file:
# reading the CSV file
csvFile = csv.DictReader(file)
# displaying the contents of the CSV file
for lines in csvFile:
resultat[i] = lines
print(lines)
i+=1
"""
2022-03-24 15:39:51 +01:00
resultat*=resultat
2022-03-24 15:54:30 +01:00
aire = 0
2022-03-18 14:29:49 +01:00
for i in range(taille-1):
2022-03-24 15:54:30 +01:00
aire += (resultat[i]+resultat[i+1]) / 2 * periode
res = aire/temps
print(res)"""