#
#  calculate crystal parameters from measured values
#
*  y1p is the parallel capacitance of fixture across Y1
#  cx is the fixture cap plus measured stray cap across it
#
#  c0 is the measured capacitance across the crystal leads
#      using an AADE L/C II meter or similar L/C meter
#
#  Rm is the measured series resistance of the crystal
#  see text
#
#  K7QO  2015
#
y1p=1.22e-12
cx=48.65e-12

# 1 crystal in standard set of K7QO

c0=3.65e-12
Rm=47.1
fs=3578435
fc=3578893

lm=1.0/(4.0*3.14159**2*(fc+fs)*(fc-fs)*(cx+c0+y1p))
cm = 1.0/(4.0*3.14159**2*lm*fs**2)

print "C0 = ",c0/1.00e-12," pF"
print "Lm = ",lm*1000.0," mH"
print "Cm = ",cm/1.0e-15," fF"
print "Rm = ",Rm," ohms"
print "Q = ",2.0*3.14159*fs*lm/Rm
