# génération des 2 courbes cibles QO18 JMLC import math import cmath fc=1000 # fréquence de croisement fl=0.8729*fc fh=1.1456*fc inf=20 # fréquence inférieure sup=20000 # fréquence supérieure N=101 # nombre de points offset=90 # décalage en dB file_low=open("low_QO18.frd","w") # nom des fichiers .frd file_high=open("high_QO18.frd","w") for i in range(0,N): f=inf*(sup/inf)**(i/(N-1)) low=1/(1+2*1j*f/fl+2*(1j*f/fl)**2+(1j*f/fl)**3) # fonctions de transfert high=(1j*f/fh)**3/(1+2*1j*f/fh+2*(1j*f/fh)**2+(1j*f/fh)**3) 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()