From 7c7a131ebfcba3d34cd9ddddb941f47a2e46caa1 Mon Sep 17 00:00:00 2001 From: Flavien Haas Date: Tue, 12 Mar 2019 21:54:24 +0000 Subject: [PATCH] Supprimer 'projet.py' --- projet.py | 57 ------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 projet.py diff --git a/projet.py b/projet.py deleted file mode 100644 index 981b040..0000000 --- a/projet.py +++ /dev/null @@ -1,57 +0,0 @@ - # -*-coding:Latin-1 -* -from math import * -print("Entrez la fréquence de coupure:") -frequence = input() -#print(f) -print("Entrez l'impédance d'entrée:") -impedance=input() -print("Entrez l'amplitude max:") -amplitude=input() -print("Entrez l'ordre du filtre:") -ordre=input() -#Calcul des paramètres -#Calcule de wc -wc=2*pi*frequence -#Calcul de b -b=log(cosh(amplitude/17.37)/sinh(amplitude/17.37)) -#Calcul de gamma -gamma=sinh(b/(2*ordre)) -#initialisation i -i=1 -ak=[0]*ordre -bk=[0]*ordre -gk=[0]*ordre -#Cacule de ak -for i in range(ordre): - ak[i-1]=sin((2*(i-1)*pi)/(2*ordre)) -#Calcul de bk -for i in range(ordre): - bk[i-1]=pow(gamma,2)+(sin(i*pi)/ordre) -print("test") -print(bk) -#Calcul de gk - -gk[0] = ((2*ak[1])/gamma) -print(ak) -print(gk[0]) -print(bk[0]) -for i in range(ordre): - gk[i]=((4*ak[i-1]*ak[i])/(bk[i-1]*gk[i-1])) -#Calcul de ck et lk -if (ordre%2)==0: - for i in range(ordre): - lk[i]=(impedance/wc)*gk[i] - for i in range(ordre): - ck[i]=(1/impedance)*(1/wc)*gk[i-1] - else: - for i in range(ordre): - lk[i]=(impedance/wc)*gk[i-1] - for i in range(ordre): - ck[i]=(1/impedance)*(1/wc)*gk[i] - #Calcul de Rn -if ordre==1: - rn=1*impedance -else: - rn=pow((tanh(b/4)),2) - -print(ck)