ajout fonction du calcul de puissance
This commit is contained in:
parent
e7dbe72e20
commit
5b19568bef
25
puissance.py
Normal file
25
puissance.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import math
|
||||||
|
from os import link
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
import struct
|
||||||
|
|
||||||
|
#"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT"
|
||||||
|
#! /usr/bin/env python3
|
||||||
|
# -*- coding: UTF-8 -*-
|
||||||
|
link = ""
|
||||||
|
|
||||||
|
f = open(link , "rb")#ouvertuture du fichier txt traiter
|
||||||
|
taille = 100
|
||||||
|
freq = 250000
|
||||||
|
periode = 1 / freq
|
||||||
|
temps = periode * taille
|
||||||
|
resultat = np.zeros(taille)
|
||||||
|
for i in range(taille):
|
||||||
|
resultat[i] = (f.readline())^2 #on sait que chaque ligne corespond à une mesure
|
||||||
|
somme = 0
|
||||||
|
for i in range(taille-1):
|
||||||
|
somme = (resultat[i] + resultat[i+1]) / 2
|
||||||
|
res = somme / temps
|
||||||
|
print(res)
|
Loading…
Reference in a new issue