# génération des 2 courbes cibles Harsch import math import cmath fc=2500 # fréquence caractéristique inf=20 # fréquence inférieure sup=20000 # fréquence supérieure N=101 # nombre de points offset=74 # décalage en dB file_low=open("low_BU3.frd","w") # nom des fichiers .frd file_high=open("high_BU3.frd","w") for i in range(0,N): f=inf*(sup/inf)**(i/(N-1)) low=1/((1+1j*f/fc)*(1+1j*f/fc+(1j*f/fc)**2)) # fonctions de transfert high=((1j*f/fc)/(1+1j*f/fc))*((1j*f/fc)**2/(1+1j*f/fc+(1j*f/fc)**2)) file_low.write(str(f)) file_low.write("\t") file_low.write(str(20*math.log10(abs(low))+offset)) file_low.write("\t") file_low.write(str(57.29*cmath.phase(low))) file_low.write("\n") file_high.write(str(f)) file_high.write("\t") file_high.write(str(20*math.log10(abs(high))+offset)) file_high.write("\t") file_high.write(str(57.29*cmath.phase(high))) file_high.write("\n") file_low.close() file_high.close()