diff --git a/PDH_error_signal/PDH_error_signal.m b/PDH_error_signal/PDH_error_signal.m new file mode 100644 index 0000000..02b30f1 --- /dev/null +++ b/PDH_error_signal/PDH_error_signal.m @@ -0,0 +1,32 @@ +clear +clc +close all + +L = 10e-2 +c = 299792458 +R = 0.99991 + +fsr = c/(2*L) + +fc = fsr*128760; +df=20e6; + +f = 2*pi*linspace(fc-df, fc+df, 10000); + +fpt = ((1.-R).*exp(-2.*L.*i.*f./c))./(1.-R.*exp(-2.*L.*i.*f./c)); +fpr = sqrt(R).*(1.-exp(-2.*L.*i.*f./c))./(1.-R.*exp(-2.*L.*i.*f./c)); + +figure +plot(f,abs(fpr)) + + +fm = 23e6; + +fm1 = sqrt(R).*(1.-exp(-2.*L.*i.*(f.+fm)./c))./(1.-R.*exp(-2.*L.*i.*(f.+fm)./c)); +fm2 = sqrt(R).*(1.-exp(-2.*L.*i.*(f.-fm)./c))./(1.-R.*exp(-2.*L.*i.*(f.-fm)./c)); + +ff=fpr.*conj(fm1)-conj(fpr).*fm2; +iff = imag(ff); + +figure +plot(f,iff) diff --git a/PDH_error_signal/PDH_error_signal.py b/PDH_error_signal/PDH_error_signal.py new file mode 100755 index 0000000..c093974 --- /dev/null +++ b/PDH_error_signal/PDH_error_signal.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +import numpy +import matplotlib.pyplot as plt + +L = 14e-2 +c = 299792458 +R = 0.99991 + +fsr = c/(2*L) +print("fsr = %f GHz"%(fsr/1e9)) + +finesse = numpy.pi*R**0.25/(1-R**0.5) +print("finesse = %i"%finesse) + +print("finesse/fsr = %f s"%(finesse/fsr)) + +fc = fsr*130000 +df = 20e6 +#print(fc) + +f = 2*numpy.pi*numpy.linspace(fc-df, fc+df, 100000) # frequency array +i = complex(0,1) + +fpt = ((1.-R)*numpy.exp(-2.*L*i*f/c))/(1.-R*numpy.exp(-2.*L*i*f/c)) +fpr = R**0.5*(1.-numpy.exp(-2.*L*i*f/c))/(1.-R*numpy.exp(-2.*L*i*f/c)) + +plt.subplot(2, 1, 1) +plt.plot(f, abs(fpr)) +plt.title('FP cavity') +plt.ylabel('Reflective intensity') +plt.grid() + + +fm = 23e6 +ram = 0 + +fm1 = R**0.5*(1.-numpy.exp(-2.*L*i*(f+fm)/c))/(1.-R*numpy.exp(-2.*L*i*(f+fm)/c)) + ram*i +fm2 = R**0.5*(1.-numpy.exp(-2.*L*i*(f-fm)/c))/(1.-R*numpy.exp(-2.*L*i*(f-fm)/c)) + ram*i + +ff = fpr*fm1.conjugate()-fpr.conjugate()*fm2 +iff = ff.imag + + +plt.subplot(2, 1, 2) +plt.plot(f, iff) +plt.xlabel('Frequency') +plt.ylabel('PDH') +plt.grid() + + +plt.show()