## 2 Basic Theoretical Analysis  
### Principle of Lock-In Amplifier and Frequency Error Analysis  
Supposing a low SNR periodic signal to be measured is:  
\[s(t)=A\sin(2\pi ft+\phi)+n(t) \tag{1}\]  
where \(A\) is the amplitude of measured signal; \(f\) is the signal's frequency; \(\phi\) is the initial phase of measured signal; and \(n(t)\) is a Gaussian white noise which satisfies the Normal distribution. The mean value of \(n(t)\) is 0, and the variance of the noise \(n(t)\) is \(D^{2}\). To avoid the phase difference between the reference signal and measured signal affecting the amplitude measurement of DLIA, the orthogonal DLIA structure is used as shown in Figure 1.  
The orthogonal DLIA has two quadrature reference signals:  
\[r_{c}(t)=B\cos(2\pi f_{1}t) \tag{2a}\] \[r_{s}(t)=B\sin(2\pi f_{1}t) \tag{2b}\]  
In Equation (2a,b), the \(B\) is the amplitude of reference signals; \(f_{1}\) is the frequency of reference signals. The orthogonal DLIA multiplies to-be-detected signal \(s(t)\) by quadrature reference signals \(r_{c}(t)\) and \(r_{s}(t)\) separately to realize the spectrum shift. Ideally, the frequency of reference signal \(f_{1}\) is identical to signal's frequency \(f\). Then, the results of these two multipliers can be obtained:  
\[R_{s}(t)=\frac{A\cdot B}{2}\{\cos(\phi)-\cos(4\pi ft+\phi)\}+n(t)r_{s}(t) \tag{3a}\] \[R_{c}(t)=\frac{A\cdot B}{2}\{\sin(\phi)+\sin(4\pi ft+\phi)\}+n(t)r_{c}(t) \tag{3b}\]  
From Equation (3), it can be seen that the measured signal has been moved to the DC region and high-frequency region, and the noise \(n(t)\) has also been moved. Therefore, a lowpass filter with a very narrow bandwidth is used to filter out the high-frequency component and noise. Typically, the integral average filter (IAF) [21] is used to realize the lowpass filter:  
Figure 1: Structure of the orthogonal lock-in amplifier. \[\overline{R}_{s} =\frac{1}{T}\int_{0}^{T}R_{s}(t)\,dt \tag{4a}\] \[=\frac{AB}{2}\text{cos}(\phi)-\frac{AB}{2T}\int_{0}^{T}\cos(4\pi ft +\phi)\,dt+\frac{1}{T}\int_{0}^{T}n(t)r_{s}(t)\,dt\] \[\overline{R}_{c} =\frac{1}{T}\int_{0}^{T}R_{c}(t)\,dt\] (4b) Figure 1.0  
where the \(T\) is the integral length which can be the period of measured signal or a constant integral length. Due to the Gaussian white noise not being correlated with the measured signal, the third term in Equation (4a,b) is zero in a specific integral length \(T\), theoretically. When the IAF has a stable output, the Equation (4) can be simplified to:  
Figure 1.1 Figure 1.2  
where the \(n^{{}^{\prime}}(t)\) is the residual noise in the actual situation due to the not-narrow-enough bandwidth of the lowpass filter. When the bandwidth of the lowpass filter is narrow enough, the residual noise \(n^{{}^{\prime}}(t)\) is also very small that it can be ignored. Then, the amplitude and initial phase of the to-be-detected signal can be obtained:  
Figure 1.3 Figure 1.4  
In some specific applications, the measurement units or sensors are far from the DLIA of signal processing equipment. The sensors and the reference signal generator of DLIA may use separate clock sources. The frequency value of the to-be-detected signal depends on one of the clock sources which is used on the sensor side, for example, the non-dispersive-infrared (NDIR) ethylene gas detection application [27]. When the detection system uses different clock sources in long-distance measurement or offline measurement applications, the difference in frequency, accuracy, and drift under different operation conditions will lead to time-varying frequency deviation \(\Delta f=f-f_{1}\) between the signal's frequency \(f\) and reference frequency \(f_{1}\). This frequency deviation \(\Delta f\) causes an additional amplitude measurement error which is irrelevant to the noise embedded in the measured signal. Meanwhile, the amplitude-frequency characteristic of an actual lowpass filter is not flat in the passband.