---
# System prepended metadata

title: Lock-in amplifier for Laser Frequecy stabilization

---

# Lock-in amplifier for Laser Frequecy stabilization
## 1. General background of Lock-in amplifier
### Lock-in capability:
measure a very low signal at interest frequency in the presence of an overwhelming noise background.  
### Principle of working: 
Based on the phase sensitive detection.
![image](https://hackmd.io/_uploads/BkYKNpt3a.png)

*Fig. 1. Principle of a Lock-in amplifier. Image used courstery of [signal recovery](https://www.ameteksi.com/-/media/ameteksi/download_links/documentations/7210/tn1000_what_is_a_lock-in_amplifier.pdf)*
Suppose the desired signal is $s_i (t)=A .cos(\omega t +\phi_1)$
Reference input (Local oscllator or external) is: $s_r(t)=BCos(\omega_r t+\phi_2)$.
The mixer (P.S.D) multiplies two signals, resulting in: $$s_o(t)=s_i*s_r=\frac{AB}{2}[Cos((\omega_i+\omega_r)t+\phi_1+\phi_2)+Cos((\omega_i-\omega_r)t+\phi_1-\phi_2)] \tag{1}$$
when $\omega_i=\omega_r$, we have
$$s_o=\frac{AB}{2}[Cos(2\omega_it+\phi_1+\phi_2)+Cos(\phi_1-\phi_2)].\tag{2}$$
This consists of two signals:
i) A high-frequency term will be filtered out by the following low-pass filter
ii) A DC signal proportional to the phase shift between the reference and the desired signal ***which is measured at the output***.
### Lock-in amplifier charateristic parameters:
#### Dynamic reserve:
Dynamic reserve is the ability to recover a signal burried under a determined noise amplitude. It depends on the selected full-scale (fully cover the measured signal) and is expressed in terms of dB. For example, if the dynamic reserve is set at $100dB$ on the full scale of $1\mu V$, the noise signal can be as large as $100 dB = 20log\frac{V_{noise}}{V_{full}} \rightarrow V_{noise}=10^5*V_{full}=0.1V$ without saturation. This requires a dynamic range of $2n*\frac{V_{noise}}{V_{signal}}=2n*10^5$, where n is the resolution of the n-bit ADC.
#### Sensitivity
### Single phase and dual phase lock-in
The above diagram shows the princple of single phase lock-in amplifier. The dual phase lock-in amplifier is similar but with the incorpertation of a second phase sensitive detection which is fed with the same input signal but a $90^o$ phase-shifted of the previous reference signal.
![dual phase lock-in](https://hackmd.io/_uploads/SyeDt4mpa.png)
The advantage of a dual phase is that even with signal phase changes $\rightarrow \phi$ changes $\rightarrow$ output at each detector X (Y) changes but the vector magnitude $R=\sqrt{X^2+Y^2}$ remains constant. This means if we choose to display $R$, changes in the signal phase will not affect the reading and no reference phase adjustment required.
## 2. Error signal generation using a lock-in amplifier for frequency stabilization.
Modulated frequency $\rightarrow$ modulated signal amplitude.
The modulated laser frequency: $\omega_L=\omega_c+A_mCos(\omega_m t)$
The saturated absorption spectroscopy (SAS)  gives Lorentzian signal which described as $$S_1(\omega_L)=L(\omega_L)=\frac{\alpha}{\beta+(\omega_L-\omega_0)^2},\tag{3}$$
where $\alpha, \beta$ are the characteristic parameters of the width and the amplitude of the signal, and $\omega_0$ is the resonance frequency.
**If the modulated amplitude is small** such that the absorption signal can be approximated by the first-order Taylor expansion in $\omega_L$ about $\omega_c$, i.e. $$ S_1(\omega_L)=L(\omega_c)+(\omega_L-\omega_c)L'(\omega_c)=L(\omega_c)+A_mCos(\omega_m t)L'(\omega_c).\tag{4}$$
The output at the mixer is 

\begin{align}
M(\omega_L)&\simeq S_1*B.Cos(\omega_mt+\phi)\\
&=[L(\omega_c)+A_mCos(\omega_m t )L'(\omega_c)]*B.Cos(\omega_m t+\phi)\tag{5} \\
&\simeq L(\omega_c).B.Cos(\omega_m t+\phi)+L'(\omega_c)*\frac {A_mB}{2}[Cos(2\omega_mt+\phi)+Cos\phi]
\end{align}
where $\phi$ indicates the phase difference between the modulation and the reference signal, $B$ is the amplitude of the reference signal.
The signal in $\eqref{eq5}$ after passing the low-pass filter with a cut-off frequency lower than the modulation frequency is $$I(\omega_L)=\frac12 A_mBL'(\omega_c)Cos(\phi)\tag{6}$$ which shows a derivative signal $L'$ of the absorption signal $L$ and the amplitude is controlled by the phas shift $\phi$. The signal serves as the error signal input for the PID feedback loop of locking the laser frequency.
**Notes:** Based on the similar idea, the third-derivative error signal can be used in order to cancel out the effect of the Gaussian background in the absorption signal. 
![signal vs derivatives](https://hackmd.io/_uploads/BJz3V7o26.jpg)
*Fig. 2. The signal of pure Lorentzian (L), Gaussian (G), and the saturated absorption in a Gaussian background L-G, and the corresponding first- and third-derivatives.*
As shown in Fig. 2, the first-derivative error signal of the saturated absorption in the Gaussian background is offset from zero. On ther other hand, the third derivatives of two signals are superimposed.Thus, either an additional experimental setup to cancel out the Gaussian background when using the first-derivative error signal or mixing the absorption with the third-harmonic of the modulation signal if using the third-derivative error signal.
:::info
* These arguments are for cases when the Gaussian width and amplitude is about many times larger than that of Lorentzian.
* If the Lorentzian amplitude is comparable to that of Gaussian, their first-derivative superimpose well and there is no shift from zero in the first-derivative error signal.
:::
The third-Taylor expansion of the signal around $\omega_c$ is 
\begin{align}
S_3(\omega_L)&=[G(\omega_c)-L(\omega_c)]\\
&=ACos(\omega_m t)[G(\omega_c)-L(\omega_c)]'\\
&=\frac12 A^2Cos^2(\omega_m t)[G(\omega_c)-L(\omega_c)]''\\
&=\frac16A^3Cos^3(\omega_m t)[G(\omega_c)-L(\omega_c)]'''
\end{align}
The mixer output is the product of $S_3*BCos(3\omega_mt+\phi)\rightarrow$low-pass filter $\rightarrow I_3(\omega_L)\propto A^3BCos(\phi)[G(\omega_c)-L(\omega_c)]'''$.