# Python script for "Duelund 4th 3 ways" import math import cmath fc=716 # centre frequency a=3.13 # factor "a" (damping) offset=85 # targets dB offset inf=15.625 # start frequency sup=32000 # end frequency N=264 # number of points (24 * 11 octaves = 264) file_low=open("low_Duelund.frd","w") # names of files file_mid=open("mid_Duelund.frd","w") file_high=open("high_Duelund.frd","w") for i in range(0,N+1): f=inf*(sup/inf)**(i/N) # frequency sweep s=1j*f/fc low=1/(1+a*s+s**2)**2 # transfer functions mid=(2-a**2)*low*s**2 high=low*s**4 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(cmath.phase(low)*180/math.pi)) file_low.write("\n") file_mid.write(str(f)) file_mid.write("\t") file_mid.write(str(20*math.log10(abs(mid))+offset)) file_mid.write("\t") file_mid.write(str(cmath.phase(mid)*180/math.pi)) file_mid.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(cmath.phase(high)*180/math.pi)) file_high.write("\n") file_low.close() file_mid.close() file_high.close()