Commit 07295cdf4404fcda6800f4183bad53f4e4179a58
1 parent
0cbce28efb
Exists in
master
add PDH_error_signal numeric simulation
Showing 2 changed files with 84 additions and 0 deletions Side-by-side Diff
PDH_error_signal/PDH_error_signal.m
1 | +clear | |
2 | +clc | |
3 | +close all | |
4 | + | |
5 | +L = 10e-2 | |
6 | +c = 299792458 | |
7 | +R = 0.99991 | |
8 | + | |
9 | +fsr = c/(2*L) | |
10 | + | |
11 | +fc = fsr*128760; | |
12 | +df=20e6; | |
13 | + | |
14 | +f = 2*pi*linspace(fc-df, fc+df, 10000); | |
15 | + | |
16 | +fpt = ((1.-R).*exp(-2.*L.*i.*f./c))./(1.-R.*exp(-2.*L.*i.*f./c)); | |
17 | +fpr = sqrt(R).*(1.-exp(-2.*L.*i.*f./c))./(1.-R.*exp(-2.*L.*i.*f./c)); | |
18 | + | |
19 | +figure | |
20 | +plot(f,abs(fpr)) | |
21 | + | |
22 | + | |
23 | +fm = 23e6; | |
24 | + | |
25 | +fm1 = sqrt(R).*(1.-exp(-2.*L.*i.*(f.+fm)./c))./(1.-R.*exp(-2.*L.*i.*(f.+fm)./c)); | |
26 | +fm2 = sqrt(R).*(1.-exp(-2.*L.*i.*(f.-fm)./c))./(1.-R.*exp(-2.*L.*i.*(f.-fm)./c)); | |
27 | + | |
28 | +ff=fpr.*conj(fm1)-conj(fpr).*fm2; | |
29 | +iff = imag(ff); | |
30 | + | |
31 | +figure | |
32 | +plot(f,iff) |
PDH_error_signal/PDH_error_signal.py
1 | +#!/usr/bin/env python | |
2 | + | |
3 | +import numpy | |
4 | +import matplotlib.pyplot as plt | |
5 | + | |
6 | +L = 14e-2 | |
7 | +c = 299792458 | |
8 | +R = 0.99991 | |
9 | + | |
10 | +fsr = c/(2*L) | |
11 | +print("fsr = %f GHz"%(fsr/1e9)) | |
12 | + | |
13 | +finesse = numpy.pi*R**0.25/(1-R**0.5) | |
14 | +print("finesse = %i"%finesse) | |
15 | + | |
16 | +print("finesse/fsr = %f s"%(finesse/fsr)) | |
17 | + | |
18 | +fc = fsr*130000 | |
19 | +df = 20e6 | |
20 | +#print(fc) | |
21 | + | |
22 | +f = 2*numpy.pi*numpy.linspace(fc-df, fc+df, 100000) # frequency array | |
23 | +i = complex(0,1) | |
24 | + | |
25 | +fpt = ((1.-R)*numpy.exp(-2.*L*i*f/c))/(1.-R*numpy.exp(-2.*L*i*f/c)) | |
26 | +fpr = R**0.5*(1.-numpy.exp(-2.*L*i*f/c))/(1.-R*numpy.exp(-2.*L*i*f/c)) | |
27 | + | |
28 | +plt.subplot(2, 1, 1) | |
29 | +plt.plot(f, abs(fpr)) | |
30 | +plt.title('FP cavity') | |
31 | +plt.ylabel('Reflective intensity') | |
32 | +plt.grid() | |
33 | + | |
34 | + | |
35 | +fm = 23e6 | |
36 | +ram = 0 | |
37 | + | |
38 | +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 | |
39 | +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 | |
40 | + | |
41 | +ff = fpr*fm1.conjugate()-fpr.conjugate()*fm2 | |
42 | +iff = ff.imag | |
43 | + | |
44 | + | |
45 | +plt.subplot(2, 1, 2) | |
46 | +plt.plot(f, iff) | |
47 | +plt.xlabel('Frequency') | |
48 | +plt.ylabel('PDH') | |
49 | +plt.grid() | |
50 | + | |
51 | + | |
52 | +plt.show() |