From 2ae5099ce4f9fc7e6ea0edff2924ea1d040acda8 Mon Sep 17 00:00:00 2001 From: mer0m Date: Fri, 20 Jan 2017 11:20:21 +0100 Subject: [PATCH] first commit --- IQ/IQ.py | 18 +++ PDH/PDH.py | 81 ++++++++++++++ .../PDH_doppler_mach-zender_eom_amont.py | 118 ++++++++++++++++++++ .../PDH_doppler_mach-zender_eom_arm.py | 106 ++++++++++++++++++ .../PDH_doppler_michelson_with_pzt.py | 122 +++++++++++++++++++++ .../PDH_doppler_michelson_without_pzt.py | 121 ++++++++++++++++++++ .../PDH_doppler_michelson_without_pzt_eom.py | 79 +++++++++++++ compensated_link/compensated_link.py | 34 ++++++ doppler/doppler.py | 19 ++++ mich_psd_calculations/calc.py | 21 ++++ michelson_w_AOM/michelson_w_AOM.py | 25 +++++ mixer/mixer.py | 20 ++++ tf_cavity/tf_cavity.py | 52 +++++++++ tf_cavity/tf_cavity_num.py | 111 +++++++++++++++++++ 14 files changed, 927 insertions(+) create mode 100644 IQ/IQ.py create mode 100644 PDH/PDH.py create mode 100644 PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_amont.py create mode 100644 PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_arm.py create mode 100644 PDH_doppler_michelson/PDH_doppler_michelson_with_pzt.py create mode 100644 PDH_doppler_michelson/PDH_doppler_michelson_without_pzt.py create mode 100644 PDH_doppler_michelson/PDH_doppler_michelson_without_pzt_eom.py create mode 100644 compensated_link/compensated_link.py create mode 100644 doppler/doppler.py create mode 100644 mich_psd_calculations/calc.py create mode 100644 michelson_w_AOM/michelson_w_AOM.py create mode 100644 mixer/mixer.py create mode 100644 tf_cavity/tf_cavity.py create mode 100644 tf_cavity/tf_cavity_num.py diff --git a/IQ/IQ.py b/IQ/IQ.py new file mode 100644 index 0000000..4d431bc --- /dev/null +++ b/IQ/IQ.py @@ -0,0 +1,18 @@ +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, E1, W, t, dphi, kphi = symbols('E0, E1, Omega, t, Delta_phi, k_phi', real=True, imaginary=False) + +#define LO and RF +LO_I = E0*cos(W*t) +LO_Q = E0*cos(W*t+pi/2) +RF = E1*cos(W*t+dphi) + +#mixer +IF_I = 2*kphi*LO_I*RF +IF_I = expand(TR8(IF_I)) +IF_Q = 2*kphi*LO_Q*RF +IF_Q = expand(TR8(IF_Q)) diff --git a/PDH/PDH.py b/PDH/PDH.py new file mode 100644 index 0000000..e8487b7 --- /dev/null +++ b/PDH/PDH.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''Pound-Drever-Hall setup + + ----- --- +------------|EOM|------|/|-----( ) + w_laser ----- --- cavity + ^ | + | U + | | + | v + |------->(X) π/2 + (w_pdh) | + ----- + |LPF| + ----- + | + v eps_pdh + +''' + +from time import time +tic = time() + +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, J0, J1, w_laser, w_pdh, t, c = symbols('E0, J0, J1, omega_laser, Omega_pdh, t, c', imaginary=False, real=True) + +'''laser and phase-mod laser +E_laser = E0*exp(I*(w_laser*t)) + +E_inc = \ +E0*( \ + J0*exp(I*((w_laser )*t)) \ ++ J1*exp(I*((w_laser+w_pdh)*t)) \ +- J1*exp(I*((w_laser-w_pdh)*t)) \ + )''' + +#reflection near resonance +dnu, w_cav = symbols('delta_nu, omega_cav', imaginary=False, real=True) +def F(phi): + dw = phi.diff(t) - w_cav + return -(I/pi)*(dw/dnu) + +#reflected phase-mod laser +v_x, d_x = symbols('v_x, delta_x', imaginary=False, real=True) +dx = v_x*t + d_x +E_ref = \ +E0*( \ + F( (w_laser )*t - w_laser*dx/c ) \ + *J0*exp(I*( (w_laser )*t - 2*w_laser*dx/c ) ) \ ++ -1*J1*exp(I*( (w_laser+w_pdh)*t - 2*w_laser*dx/c ) ) \ +- -1*J1*exp(I*( (w_laser-w_pdh)*t - 2*w_laser*dx/c ) ) \ + ) + +#intensity of reflected phase-mod laser +I_pdh = abs(E_ref)**2 +I_pdh = expand(TR8(expand(expand_complex(I_pdh)))) + +#demodulation of I_pdh at Omega_pdh +kphipdh = symbols('k_phi_pdh', imaginary=False, real=True) +eps_pdh = 2 * kphipdh * I_pdh * cos(w_pdh*t-pi/2) +eps_pdh = expand(TR8(TR7(expand(eps_pdh)))) + +toc = time() +print('Elapsed time : %fs'%(toc-tic)) + +'''low-passed demodulated I_pdh signal + +eps_pdh = + 2 ⎛ ω_laser ⎞ + 4⋅E₀ ⋅J₀⋅J₁⋅k_φ_pdh⋅⎜ω_laser - ω_cav - ───────⋅vₓ⎟ + ⎝ c ⎠ + + ────────────────────────────────────────────────── + π⋅δ_ν +''' diff --git a/PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_amont.py b/PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_amont.py new file mode 100644 index 0000000..0b8e510 --- /dev/null +++ b/PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_amont.py @@ -0,0 +1,118 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''Pound-Drever-Hall setup + Mach-Zender with one photodiode + + ----- --- --- +---------|EOM|-|\|------------|/|-----------( ) + w_laser ----- --- --- cavity + | | + | | + | ----- --- + \-|AOM|-------|\| + ----- --- + ^ | + | U + | | + | V + |-------->(X) + | | ----- + (W_aom) |---|LPF|--> eps_dop + V ----- + (W_pdh)---------->(X) + | + | + V eps_pdh + + + +''' + +from time import time +tic = time() + +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, J0, J1, w_laser, w_pdh, w_aom, t = symbols('E0, J0, J1, omega_laser, Omega_pdh, Omega_aom, t', imaginary=False, real=True) +v_x, d_x = symbols('v_x, delta_x', imaginary=False, real=True) +c = symbols('c', imaginary=False, real=True) + +#laser and phase-mod laser +E_laser = E0*exp(I*(w_laser*t)) + +E_aom_eom = \ +E0*( \ + J0*exp(I*( ( w_laser+w_aom )*t) ) \ ++ J1*exp(I*( ( w_laser+w_aom+w_pdh )*t) ) \ +- J1*exp(I*( ( w_laser+w_aom-w_pdh )*t) ) ) + + +E_eom = \ +E0*( \ + J0*exp(I*( ( w_laser )*t ) ) \ ++ J1*exp(I*( ( w_laser+w_pdh )*t ) ) \ +- J1*exp(I*( ( w_laser-w_pdh )*t ) ) ) + +#approximation of F(w) near a resonance +dnu, w_cav = symbols('delta_nu, omega_cav', imaginary=False, real=True) +def F(phi): + dw = phi.diff(t) - w_cav + return -(I/pi)*(dw/dnu) + +#reflected phase-mod laser and dephased by doppler effect and by actuator +dx = v_x*t + d_x +E_ref = \ +E0*( \ + F( w_laser*t - w_laser*(dx)/(2*pi*c) ) \ + *J0*exp( I*( (w_laser )*t - 2*w_laser*dx/c ) ) \ ++ -1*J1*exp( I*( (w_laser+w_pdh)*t - 2*w_laser*dx/c ) ) \ +- -1*J1*exp( I*( (w_laser-w_pdh)*t - 2*w_laser*dx/c ) ) \ + ) + +#optical mixer +E_mz = sqrt(2)/2 * E_aom_eom + sqrt(2)/2 * E_ref + +#intensity of mixed wave +I_mz = abs(E_mz)**2 +I_mz = expand(TR8(expand(expand_complex(I_mz)))) + + +#Q demodulation of I_mz at Omega_aom for doppler error signal obtention +kphidop = symbols('k_phi_doppler', real=True) +eps_dop = 2 * kphidop * I_mz * cos(w_aom*t-pi/2) +eps_dop = expand(TR8(TR7(expand(eps_dop)))) + +#Q demodulation of I_mich at Omega_pdh for doppler error signal obtention +kphipdh = symbols('k_phi_pdh', real=True) +eps_pdh = 2 * kphipdh * eps_dop * cos(w_pdh*t) +eps_pdh = expand(TR8(TR7(expand(eps_pdh)))) + +toc = time() +print('Elapsed time : %fs'%(toc-tic)) + +'''results + +### EOM sur un bras + +eps_pdh = + +0 + +eps_dop = + + 2 ⎛ ω_laser⋅vₓ⎞ ⎛2⋅δₓ⋅ω_laser 2⋅ω_laser⋅t⋅vₓ⎞ + E₀ ⋅J₀ ⋅k_φ_doppler⋅⎜ω_laser - ω_cav - ──────────⎟⋅cos⎜──────────── + ──────────────⎟ + ⎝ c ⎠ ⎝ c c ⎠ +- ───────────────────────────────────────────────────────────────────────────────────── + π⋅δ_ν + + 2 2 ⎛ δₓ⋅ω_laser ω_laser⋅t⋅vₓ⎞ ++ 2⋅E₀ ⋅J₁ ⋅k_φ_doppler⋅sin⎜2⋅────────── + 2⋅────────────⎟ + ⎝ c c ⎠ + +''' diff --git a/PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_arm.py b/PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_arm.py new file mode 100644 index 0000000..6b7a734 --- /dev/null +++ b/PDH_doppler_mach-zender/PDH_doppler_mach-zender_eom_arm.py @@ -0,0 +1,106 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''Pound-Drever-Hall setup + Mach-Zender with one photodiode + + --- ----- --- +----------|\|---|EOM|---------|/|-----------( ) + w_laser --- ----- --- cavity + | | + | | + | ----- --- + \----|AOM|---------|\| + ----- --- + ^ | + | U + | | + | V + |---------->(X) + | | ----- + (W_aom) |---|LPF|--> eps_dop + V ----- + (W_pdh)---------->(X) + | + | + V eps_pdh + + + +''' + +from time import time +tic = time() + +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, J0, J1, w_laser, w_pdh, w_aom, t = symbols('E0, J0, J1, omega_laser, Omega_pdh, Omega_aom, t', imaginary=False, real=True) +v_x, d_x = symbols('v_x, delta_x', imaginary=False, real=True) +c = symbols('c', imaginary=False, real=True) + +#laser and phase-mod laser +E_laser = E0*exp(I*(w_laser*t)) + +E_aom = E0*exp(I*((w_laser+w_aom)*t)) + +E_eom = \ +E0*( \ + J0*exp(I*( ( w_laser )*t ) ) \ ++ J1*exp(I*( ( w_laser+w_pdh)*t ) ) \ +- J1*exp(I*( ( w_laser-w_pdh)*t ) ) ) + +#approximation of F(w) near a resonance +dnu, w_cav = symbols('delta_nu, omega_cav', imaginary=False, real=True) +def F(phi): + dw = phi.diff(t) - w_cav + return -(I/pi)*(dw/dnu) + +#reflected phase-mod laser and dephased by doppler effect and by actuator +dx = v_x*t + d_x +E_ref = \ +E0*( \ + F( w_laser *t - w_laser*dx/c ) \ + *J0*exp( I*( w_laser *t - 2*w_laser*dx/c ) ) \ ++ -1*J1*exp( I*( (w_laser+w_pdh)*t - 2*w_laser*dx/c ) ) \ +- -1*J1*exp( I*( (w_laser-w_pdh)*t - 2*w_laser*dx/c ) ) \ + ) + +#optical mixer +E_mz = sqrt(2)/2 * E_aom + sqrt(2)/2 * E_ref + +#intensity of mixed wave +I_mz = abs(E_mz)**2 +I_mz = expand(TR8(expand(expand_complex(I_mz)))) + + +#Q demodulation of I_mz at Omega_aom for doppler error signal obtention +kphidop = symbols('k_phi_doppler', real=True) +eps_dop = 2 * kphidop * I_mz * cos(w_aom*t-pi/2) +eps_dop = expand(TR8(TR7(expand(eps_dop)))) + +#Q demodulation of I_mich at Omega_pdh for doppler error signal obtention +kphipdh = symbols('k_phi_pdh', real=True) +eps_pdh = 2 * kphipdh * eps_dop * cos(w_pdh*t) +eps_pdh = expand(TR8(TR7(expand(eps_pdh)))) + +toc = time() +print('Elapsed time : %fs'%(toc-tic)) + +'''results + +### EOM sur un bras + +eps_pdh = +0 + +eps_dop = + 2 ⎛ ω_laser⋅vₓ⎞ ⎛2⋅δₓ⋅ω_laser 2⋅ω_laser⋅t⋅vₓ⎞ + E₀ ⋅J₀ ⋅k_φ_doppler⋅⎜ω_laser - ω_cav - ──────────⎟⋅cos⎜──────────── + ──────────────⎟ + ⎝ c ⎠ ⎝ c c ⎠ +- ───────────────────────────────────────────────────────────────────────────────────── + π⋅δ_ν +''' diff --git a/PDH_doppler_michelson/PDH_doppler_michelson_with_pzt.py b/PDH_doppler_michelson/PDH_doppler_michelson_with_pzt.py new file mode 100644 index 0000000..8a2a06e --- /dev/null +++ b/PDH_doppler_michelson/PDH_doppler_michelson_with_pzt.py @@ -0,0 +1,122 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''Pound-Drever-Hall setup + Michelson with piezo actuator in cavity arm and AOM in reference arm + + ----- + (2*W_aom)-->(X)---|LPF|---> + | ----- eps_dop + O + | + ----- --- --- +------------|EOM|---|\|---|/|-----------( ) + w_laser ----- --- --- cavity + ^ | | + | ----- U + | |AOM| | + | ----- | + | _|_ | + | //// | + | v + |---------->(X) + (W_pdh) | + ----- + |LPF| + ----- + | + v eps_pdh + +''' + +from time import time +tic = time() + +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, J0, J1, w_laser, w_pdh, w_aom, t, c = symbols('E0, J0, J1, omega_laser, Omega_pdh, Omega_aom, t, c', imaginary=False, real=True) + +'''#laser and phase-mod laser +E_laser = E0*exp(I*(w_laser*t)) + +E_eom = \ +E0*( \ + J0*exp(I*(w_laser*t)) \ ++ J1*exp(I*((w_laser+w_pdh)*t)) \ +- J1*exp(I*((w_laser-w_pdh)*t)) \ + )''' + +#aom double shifted phase-mod wave in reference arm +E_aom = \ +E0*( \ + J0*exp(I*((w_laser +2*w_aom)*t)) \ ++ J1*exp(I*((w_laser+w_pdh+2*w_aom)*t)) \ +- J1*exp(I*((w_laser-w_pdh+2*w_aom)*t)) \ + ) + +#approximation of F(w) near a resonance +dnu, w_cav = symbols('delta_nu, omega_cav', imaginary=False, real=True) +def F(phi): + dw = phi.diff(t) - w_cav + return -(I/pi)*(dw/dnu) + +#reflected phase-mod laser and dephased by doppler effect +v_x, d_x, v_u, d_u = symbols('v_x, delta_x, v_u, delta_u', imaginary=False, real=True) +dx = v_x*t + d_x +du = v_u*t + d_u +E_ref = \ +E0*( \ + F( w_laser *t - (dx+du)*(w_laser)/c ) \ + *J0*exp( I*( w_laser *t - 2*(dx+du)*(w_laser)/c ) ) \ ++ -1*J1*exp( I*( (w_laser+w_pdh)*t - 2*(dx+du)*(w_laser)/c ) ) \ +- -1*J1*exp( I*( (w_laser-w_pdh)*t - 2*(dx+du)*(w_laser)/c ) ) \ + ) + +#intensity of reflected wave +I_pdh = abs(E_ref)**2 +I_pdh = expand(TR8(expand(expand_complex(I_pdh)))) + +#optical mixer +E_mich = sqrt(2)/2 * E_aom + sqrt(2)/2 * E_ref + +#intensity of mixed wave +I_mich = abs(E_mich)**2 +I_mich = expand(TR8(expand(expand_complex(I_mich)))) + +#Q demodulation of I_pdh at Omega_pdh for PDH error signal obtention +kphipdh = symbols('k_phi_pdh', real=True) +eps_pdh = 2 * kphipdh * I_pdh * cos(w_pdh*t-pi/2) +eps_pdh = expand(TR8(TR7(expand(eps_pdh)))) + +#Q demodulation of I_mich at 2*Omega_aom for doppler error signal obtention +kphidop = symbols('k_phi_doppler', real=True) +eps_dop = 2 * kphidop * I_mich * cos(2*w_aom*t-pi/2) +eps_dop = expand(TR8(TR7(expand(eps_dop)))) + +toc = time() +print('Elapsed time : %fs'%(toc-tic)) + +'''results + +eps_pdh = + 2 ⎛ ω_laser ⎞ + 4⋅E₀ ⋅J₀⋅J₁⋅k_φ_pdh⋅⎜ω_laser - ω_cav - ───────⋅(vₓ+vᵤ)⎟ + ⎝ c ⎠ + + ─────────────────────────────────────────────────────── + π⋅δ_ν + +eps_dop = + 2 2 ⎛ ω_laser ⎞ ⎛2⋅[(δₓ+t⋅vₓ)+(δᵤ+t⋅vᵤ)]⋅ω_laser⎞ + E₀ ⋅J₀ ⋅k_φ_doppler⋅⎜ω_laser - ω_cav - ───────⋅(vₓ+vᵤ)⎟⋅cos⎜───────────────────────────────⎟ + ⎝ c ⎠ ⎝ c ⎠ +- ──────────────────────────────────────────────────────────────────────────────────────────── + π⋅δ_ν + + 2 2 ⎛2⋅[(δₓ+t⋅vₓ)+(δᵤ+t⋅vᵤ)]⋅ω_laser⎞ ++ 2⋅E₀ ⋅J₁ ⋅k_φ_doppler⋅sin⎜───────────────────────────────⎟ + ⎝ c ⎠ +''' diff --git a/PDH_doppler_michelson/PDH_doppler_michelson_without_pzt.py b/PDH_doppler_michelson/PDH_doppler_michelson_without_pzt.py new file mode 100644 index 0000000..9d03753 --- /dev/null +++ b/PDH_doppler_michelson/PDH_doppler_michelson_without_pzt.py @@ -0,0 +1,121 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''Pound-Drever-Hall setup + Michelson with piezo actuator and AOM in cavity arm + + ----- + (2*W_aom)-->(X)---|LPF|---> + | ----- eps_dop + O + | + ----- --- --- ----- +------------|EOM|---|\|---|/|---|AOM|---( ) + w_laser ----- --- --- ----- cavity + ^ | | + | | U + | | | + | | | + | _|_ | + | //// | + | v + |---------->(X) + (W_pdh) | + ----- + |LPF| + ----- + | + v eps_pdh + +''' + +from time import time +tic = time() + +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, J0, J1, w_laser, w_pdh, t = symbols('E0, J0, J1, omega_laser, Omega_pdh, t', imaginary=False, real=True) +v_x, d_x, c = symbols('v_x, delta_x, c', imaginary=False, real=True) +w_aom, dw, dphi = symbols('Omega_aom, delta_Omega, delta_phi', imaginary=False, real=True) + +phi_u = dw*t #+ dphi +phi = w_aom*t + phi_u + +'''# +#laser +E_laser = E0*exp(I*(w_laser*t)) +''' + +#phase-mod laser +E_eom = \ +E0*( \ + J0*exp(I*((w_laser )*t)) \ ++ J1*exp(I*((w_laser+w_pdh)*t)) \ +- J1*exp(I*((w_laser-w_pdh)*t)) \ + ) + +#approximation of F(w) near a resonance +dnu, w_cav = symbols('delta_nu, omega_cav', imaginary=False, real=True) +def F(phi): + dw = phi.diff(t) - w_cav + return -(I/pi)*(dw/dnu) + +#reflected phase-mod laser and dephased by doppler effect with double aom shift +dx = v_x*t + d_x +E_ref = \ +E0*( \ + F( (w_laser )*t - dx*(w_laser+phi.diff(t))/c + phi ) \ + * J0*exp( I*( (w_laser )*t - 2*dx*(w_laser+phi.diff(t))/c + 2*phi ) ) \ ++ -1*J1*exp( I*( (w_laser+w_pdh)*t - 2*dx*(w_laser+phi.diff(t))/c + 2*phi ) ) \ +- -1*J1*exp( I*( (w_laser-w_pdh)*t - 2*dx*(w_laser+phi.diff(t))/c + 2*phi ) ) \ + ) + +#intensity of reflected wave +I_pdh = abs(E_ref)**2 +I_pdh = expand(TR8(expand(expand_complex(I_pdh)))) + +#optical mixer +E_mich = sqrt(2)/2 * E_eom + sqrt(2)/2 * E_ref + +#intensity of mixed wave +I_mich = abs(E_mich)**2 +I_mich = expand(TR8(expand(expand_complex(I_mich)))) + +#Q demodulation of I_pdh at Omega_pdh for PDH error signal obtention +kphipdh = symbols('k_phi_pdh', real=True) +eps_pdh = 2 * kphipdh * I_pdh * cos(w_pdh*t-pi/2) +eps_pdh = expand(TR8(TR7(expand(eps_pdh)))) + +#Q demodulation of I_mich at 2*Omega_aom for doppler error signal obtention +kphidop = symbols('k_phi_doppler', real=True) +eps_dop = 2 * kphidop * I_mich * cos(2*w_aom*t-pi/2) +#eps_dop = 2 * kphidop * I_mich * cos(2*phi.diff(t)*t-pi/2) +eps_dop = expand(TR8(TR7(expand(eps_dop)))) + +toc = time() +print('Elapsed time : %fs'%(toc-tic)) + +'''results + +eps_pdh = + 2 ⎛ ω_laser + Ω_aom + δ_Ω ⎞ + 4⋅E₀ ⋅J₀⋅J₁⋅k_φ_pdh⋅⎜ω_laser + Ω_aom - ω_cav + δ_Ω - ─────────────────────⋅vₓ⎟ + ⎝ c ⎠ + + ────────────────────────────────────────────────────────────────────────────── + π⋅δ_ν + +eps_dop = + 2 2 ⎛ ω_laser + Ω_aom + δ_Ω ⎞ ⎛ 2⋅(ω_laser + Ω_aom + δ_Ω)⋅(vₓ⋅t+δₓ)⎞ + E₀ ⋅J₀ ⋅k_φ_dop⋅⎜ω_laser + Ω_aom - ω_cav + δ_Ω - ─────────────────────⋅vₓ⎟⋅cos⎜2⋅δ_Ω⋅t - ───────────────────────────────────⎟ + ⎝ c ⎠ ⎝ c ⎠ + ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── + π⋅δ_ν + + 2 2 ⎛ 2⋅(ω_laser + Ω_aom + δ_Ω)⋅(vₓ⋅t+δₓ)⎞ ++ 2⋅E₀ ⋅J₁ ⋅k_φ_dop⋅sin⎜2⋅δ_Ω⋅t - ───────────────────────────────────⎟ + ⎝ c ⎠ +''' diff --git a/PDH_doppler_michelson/PDH_doppler_michelson_without_pzt_eom.py b/PDH_doppler_michelson/PDH_doppler_michelson_without_pzt_eom.py new file mode 100644 index 0000000..576225b --- /dev/null +++ b/PDH_doppler_michelson/PDH_doppler_michelson_without_pzt_eom.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''pseudo Pound-Drever-Hall setup + + ----- + (2*W_aom)-->(X)---|LPF|---> + | ----- eps + O + | + --- +--------------------|\|-----------------( ) + w_laser --- cavity + | + ----- + |AOM| + ----- + _|_ + //// + +''' + +from time import time +tic = time() + +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, J0, J1, w_laser, w_pdh, t = symbols('E0, J0, J1, omega_laser, Omega_pdh, t', imaginary=False, real=True) +v_x, d_x, c = symbols('v_x, delta_x, c', imaginary=False, real=True) +w_aom = symbols('Omega_aom', imaginary=False, real=True) + +#laser and phase-mod laser +E_laser = E0*exp(I*(w_laser*t)) + +#aom shifted phase-mod wave +E_aom = \ + E0*exp(I*((w_laser+2*w_aom)*t)) + +#approximation of F(w) near a resonance +dnu, w_cav = symbols('delta_nu, omega_cav', imaginary=False, real=True) +def F(phi): + dw = phi.diff(t) - w_cav + return -(I/pi)*(dw/dnu) + +#reflected phase-mod laser and dephased by doppler effect with double aom shift +dx = v_x*t + d_x +E_ref = \ + F( (w_laser)*t - (w_laser)*(dx)/(2*pi*c) ) * E0*exp( I*( (w_laser)*t - (w_laser)*(2*dx)/c ) ) + +#optical mixer +E_mich = sqrt(2)/2 * E_aom + sqrt(2)/2 * E_ref + +#intensity of mixed wave +I_mich = abs(E_mich)**2 +I_mich = expand(TR8(expand(expand_complex(I_mich)))) + +#Q demodulation of I_mich at 2*Omega_aom for doppler error signal obtention +kphi = symbols('k_phi', real=True) +eps = 2 * kphi * I_mich * cos(2*w_aom*t-pi/2) +eps = expand(TR8(TR7(expand(eps)))) + +toc = time() +print('Elapsed time : %fs'%(toc-tic)) + +'''results + +eps = + + 2 ⎛ ω_laser ⎞ ⎛2⋅δₓ⋅ω_laser 2⋅ω_laser⋅t⋅vₓ⎞ + 2⋅E₀ ⋅J₀⋅J₁⋅k_φ_pdh⋅⎜ω_laser - ω_cav - ───────⋅vₓ⎟⋅cos⎜──────────── + ──────────────⎟ + ⎝ c ⎠ ⎝ c c ⎠ + - ───────────────────────────────────────────────────────────────────────────────────── + π⋅δ_ν + +''' diff --git a/compensated_link/compensated_link.py b/compensated_link/compensated_link.py new file mode 100644 index 0000000..f040390 --- /dev/null +++ b/compensated_link/compensated_link.py @@ -0,0 +1,34 @@ +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, w_laser, W_aom, t = symbols('E0, omega_laser, Omega_aom, t', real=True, imaginary=False) +dphi, dW = symbols('Delta_phi, Delta_Omega', real=True, imaginary=False) +c, dx = symbols('c, Delta_x', real=True, imaginary=False) + +phi_u = dW*t + dphi +phi = W_aom*t + phi_u + +#laser +E_laser = E0*exp(I*(w_laser*t)) + +#reflected wave and dephased by doppler and noise and double shifted +E_aom_ref = E0*exp(I*( w_laser*t + 2*dx*(w_laser+phi.diff(t))/c + 2*phi )) + +#reflected wave on the reference arm of michelson +E_ref = E_laser + +#optical mixer +E_mix = sqrt(2)/2*E_ref + sqrt(2)/2*E_aom_ref + +#intensity of mixed waves +I_mix = abs(E_mix)**2 +I_mix = expand(TR8(expand(expand_complex(I_mix)))) + +#Q demodulation +kphi = symbols('k_phi', real=True, imaginary=False) +#eps = 2 * kphi * I_mix * cos(2*phi.diff(t)*t-pi/2) +eps = 2 * kphi * I_mix * cos(2*W_aom*t-pi/2) +eps = expand(TR8(TR7(expand(eps)))) diff --git a/doppler/doppler.py b/doppler/doppler.py new file mode 100644 index 0000000..7bbe8b0 --- /dev/null +++ b/doppler/doppler.py @@ -0,0 +1,19 @@ +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +A, B, w, t, kphi, c = symbols('A, B, omega, t, k_phi, c', imaginary=False, real=True) +dx = symbols('delta_x', cls=Function) +#wave vector +k = w/c + +#reflected wave +E1 = A*cos(w*t-2*k*dx(t)) + +#demodulation of E1 at omega in quadrature +E2 = B*cos(w*t-pi/2) +Vmix = 2 * kphi * E1 * E2 +Vmix = expand(TR8(TR7(expand(Vmix)))) +print('V_mixer = \n' + pretty(Vmix)) diff --git a/mich_psd_calculations/calc.py b/mich_psd_calculations/calc.py new file mode 100644 index 0000000..613be29 --- /dev/null +++ b/mich_psd_calculations/calc.py @@ -0,0 +1,21 @@ +from numpy import log, log10, pi + +#constants +c = 3E8 +nu = c/1542E-9 +f = 1 + +#allan deviation aimed +sigma_y = 1E-17 + +#PSD of frequency fluctuations (frequency flicker) in dB.Hz^-1 +Sy = 10*log10(sigma_y**2/(2*log(2))) + +#PSD of phase fluctuations in dB.rad^2.Hz^-1 +Sphi = Sy + 20*log10(nu) - 20*log10(f) + +#PSD of time delay fluctuations in dB.s^2.Hz^-1 +Sx = Sphi - 20*log10(2*pi*nu) + +#PSD of position fluctuations in dB.m^2.Hz^-1 +Su = Sphi + 20*log10(c) - 20*log10(2*pi*nu) -20*log10(2) diff --git a/michelson_w_AOM/michelson_w_AOM.py b/michelson_w_AOM/michelson_w_AOM.py new file mode 100644 index 0000000..c2c23f4 --- /dev/null +++ b/michelson_w_AOM/michelson_w_AOM.py @@ -0,0 +1,25 @@ +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +#constants +E0, E1, w, W, t, dphi, kphi = symbols('E0, E1, omega, Omega, t, Delta_phi, k_phi', real=True, imaginary=False) +dx, du, c = symbols('Delta_x, Delta_u, c', real=True, imaginary=False) + +#reference wave +Eb0 = E0*exp(I*(w*t)) + +#double Omega shifted and dphi dephased wave +Eb1 = E1*exp(I*((w+2*W)*t -2*w*(dx+2*du)/c)) + +#optical mixer +Emix = sqrt(2)/2 * Eb0 + sqrt(2)/2 * Eb1 + +#intensity of mixed waves +Imix = simplify(expand_complex(abs(Emix)**2)) + +#demodulation Q at 2 * Omega +Vmix = 2 * kphi * Imix * cos(2*W*t-pi/2) +Vmix = expand(TR8(TR7(expand(Vmix)))) +print(pretty(Vmix)) diff --git a/mixer/mixer.py b/mixer/mixer.py new file mode 100644 index 0000000..fa9944f --- /dev/null +++ b/mixer/mixer.py @@ -0,0 +1,20 @@ +from sympy import * +from sympy.simplify.fu import * + +init_printing() + +A, B, w, t, dphi = symbols('A, B, omega, t, Delta_phi', real=True, imaginary=False) + +#polynimial approach of RF mixer +k1, k2, k3 = symbols('k1, k2, k3', real=True, imaginary=False) +e = A*cos(w*t) + B*cos(w*t+dphi-pi/2) +Vmix_poly = k1*e + k2*e**2 +Vmix_poly = expand(TR8(TR7(expand(Vmix_poly)))) + +print('Polynomial result :\n' + pretty(Vmix_poly) + '\n') + +#product approach of RF mixer +kphi = symbols('k_phi', real=True, imaginary=False) +Vmix_prod = 2 * kphi * A*cos(w*t) * B*cos(w*t+dphi-pi/2) +Vmix_prod = expand(TR8(TR7(expand(Vmix_prod)))) +print('Product result :\n' + pretty(Vmix_prod)) diff --git a/tf_cavity/tf_cavity.py b/tf_cavity/tf_cavity.py new file mode 100644 index 0000000..de7fd14 --- /dev/null +++ b/tf_cavity/tf_cavity.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''TF of FP cavity in reflection + + ---------- + X(s) ----- | -tau⋅s | +-------------->|1-R|----->(X)----->|e |------ + | ----- ^ ---------- | + | | | + | | V + ---- ---- ---- + |-R| |-R| |-R| + ---- ---- ---- + | ^ | + | | ---------- | + Y(s) V ----- | | -tau⋅s | | +<-----(X)<-----|1-R|<--------------|e |<----- + ----- ---------- + +''' + +from sympy import * + +init_printing() + +w, r, L, c = symbols('omega, r, L, c', imaginary=False, real=True) + +tau = L/c +fsr = 1/(2*tau) + +#TF of cavity in reflection +def Fr(w): + s = 1j*w + return r*(exp(-2*tau*s)-1)/(1-r**2*exp(-2*tau*s)) + +dw = symbols('dw', imaginary=False, real=True) +Fr_dw_0 = simplify(simplify(Fr(2*pi*fsr+dw).series(dw, 0, 2).expand().coeff(dw))*dw) + +'''results + + ⎛ -2.0⋅ⅈ⋅L⋅ω ⎞ + ⎜ ───────────⎟ + ⎜ c ⎟ + r⋅⎝-1 + ℯ ⎠ +F(w) = ───────────────────── + -2.0⋅ⅈ⋅L⋅ω + ─────────── + 2 c + - r ⋅ℯ + 1 + +''' diff --git a/tf_cavity/tf_cavity_num.py b/tf_cavity/tf_cavity_num.py new file mode 100644 index 0000000..85fcc77 --- /dev/null +++ b/tf_cavity/tf_cavity_num.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +'''TF of FP cavity in reflection + + ---------- + X(s) ----- | -tau⋅s | +-------------->|1-R|----->(X)----->|e |------ + | ----- ^ ---------- | + | | | + | | V + ---- ---- ---- + |-R| |-R| |-R| + ---- ---- ---- + | ^ | + | | ---------- | + Y(s) V ----- | | -tau⋅s | | +<-----(X)<-----|1-R|<--------------|e |<----- + ----- ---------- + +''' + +'''import matplotlib as mpl +mpl.use('pgf') + +def figsize(scale): + fig_width_pt = 469.755 # Get this from LaTeX using \the\textwidth + inches_per_pt = 1.0/72.27 # Convert pt to inch + golden_mean = (5.0**0.5-1.0)/2.0 # Aesthetic ratio (you could change this) + fig_width = fig_width_pt*inches_per_pt*scale # width in inches + fig_height = fig_width*golden_mean # height in inches + fig_size = [fig_width,fig_height] + return fig_size + +pgf_with_latex = { # setup matplotlib to use latex for output + "pgf.texsystem": "pdflatex", # change this if using xetex or lautex + "text.usetex": True, # use LaTeX to write all text + "font.family": "serif", + "font.serif": [], # blank entries should cause plots to inherit fonts from the document + "font.sans-serif": [], + "font.monospace": [], + "axes.labelsize": 10, # LaTeX default is 10pt font. + "text.fontsize": 10, + "legend.fontsize": 8, # Make the legend/label fonts a little smaller + "xtick.labelsize": 8, + "ytick.labelsize": 8, + "figure.figsize": figsize(0.9), # default fig size of 0.9 textwidth + "pgf.preamble": [ + r"\usepackage[utf8x]{inputenc}", # use utf8 fonts becasue your computer can handle it :) + r"\usepackage[T1]{fontenc}", # plots will be generated using this preamble + ] + } +mpl.rcParams.update(pgf_with_latex) +''' +from numpy import * +import matplotlib.pyplot as plt + +r = 0.99 +L = 140e-3 +c = 299792458 + +tau = L/c +fsr = 1/(2*tau) + +f0 = (193e12//fsr)*fsr +f = linspace(f0-0.1*fsr, f0+0.1*fsr, 1e5) + +#TF of cavity in reflection +def Fr(w): + s = 1j*w + return r*(exp(-2*tau*s)-1)/(1-r**2*exp(-2*tau*s)) + +G = Fr(2*pi*f) + +#plot bode of F(w) +ax1 = plt.subplot(3, 1, 1) +ax1.set_ylabel('Magnitude') +ax1.plot(f, abs(G)) +ax1.grid() + +ax2 = plt.subplot(3, 1, 2, sharex = ax1) +ax2.set_ylabel('Phase (deg)') +ax2.set_xlabel('omega (rad.s$^{-1}$)') +ax2.plot(f, angle(G, deg = True)) +ax2.grid() + + +#nyquist +ax3 = plt.subplot(3, 1, 3) +ax3.set_ylabel('$j\omega$') +ax3.set_xlabel('$\sigma$') +ax3.plot(real(G), imag(G)) +ax3.grid() +ax3.axis('equal') + +#plt.savefig('fig.pgf') +plt.show() + +'''results + + ⎛ -2.0⋅ⅈ⋅L⋅ω ⎞ + ⎜ ───────────⎟ + ⎜ c ⎟ + r⋅⎝-1 + ℯ ⎠ +F(w) = ───────────────────── + -2.0⋅ⅈ⋅L⋅ω + ─────────── + 2 c + - r ⋅ℯ + 1 + +''' -- 2.16.4