## 2 Basic Theoretical Analysis
### Frequency Estimation  
Because the amplitude measurement accuracy of the detected signal by the DLIA is restricted by the frequency deviation \(\Delta f\), except for the noise in the measured signal itself, it is necessary to directly estimate the accurate frequency of the signal to generate corresponding reference signals. For a low SNR signal in Equation (1), assuming the sampling rate is \(f_{s}\), the discrete signal sequence is:  
\[s[n]=A\sin(2\pi\frac{f}{f_{s}}n+\phi)+N(n) \tag{11}\]  
where \(n=0\), \(1\), \(\cdots\)\(N-1\); \(N\) is the length of signal sequence. Then, the Discrete Fourier Transform (DFT) sequence can be calculated by the FFT algorithm:  
\[S[k]=DFT\{s[n]\}=\sum_{n=0}^{N-1}s[n]e^{-j\frac{2\pi nk}{N}} \tag{12}\]  
where \(k\in[0,N-1]\). Ignoring the noise, in the spectrum of signal \(s[n]\), the frequency of the actual signal corresponds to a spectral line with the largest amplitude whose index is represented as \(p_{k}\). However, the spectrum is discrete, the index \(p_{k}\) represents a coarse frequency value, and the actual signal frequency can be calculated by:  
\[f=(p_{k}+\delta_{k})\frac{f_{s}}{N} \tag{13}\]  
Figure 2: Relative error of amplitude influenced by the frequency deviation: (**a**) initial phase of measured signal is zero and frequency deviation varies; (**b**) frequency deviation is fixed and initial phase of measured signal is non-zero. where \(\delta_{k}\in[-0.5,0.5]\) is the fractional residual part. The DFT discrete spectrum can only obtain the integer part \(p_{k}\). Therefore, there is a limited frequency resolution \(\frac{f_{s}}{N}\), which is constrained by sampling rate \(f_{s}\) and signal sequence length \(N\). Due to the to-be-detected signal corresponding to a spectral line with the largest amplitude in the frequency domain, the frequency estimate issue can be transformed into a maximum optimization problem which is:  
\[\hat{p}_{k}=\operatorname*{arg\,max}_{0\leq k\leq\frac{N}{2}-1}\{|S[k]|\} \tag{14}\]  
In Equation (14), \(k\in[0,\frac{N}{2}-1]\) is a real number. Furthermore, according to the Euler formula and combining Equations (12) and (14), the frequency estimation task can be rewritten as:  
\[\hat{f}=\operatorname*{arg\,max}_{f}\{|X(f)|\}=\operatorname*{arg\,max}_{f}\{ \sqrt{X_{R}^{2}(f)+X_{I}^{2}(f)}\} \tag{15a}\] \[X_{R}(f) =\ \sum_{0}^{N-1}s[n]\text{cos}(2\pi n\frac{f}{f_{s}})\] (15b) \[X_{I}(f) =-\ \sum_{0}^{N-1}s[n]\text{sin}(2\pi n\frac{f}{f_{s}})\]  
where \(f\in[\,(p_{k}-0.5)\frac{f_{s}}{N}\,,\,(p_{k}+0.5)\frac{f_{s}}{N}\,]\). Therefore, when estimating the frequency of a signal as shown in Equation (11), the DFT is firstly processed on the signal sequence \(s[n]\) to obtain its spectrum. Then, the \(p_{k}\), which is the index of spectral line with largest amplitude, is found out. Finally, in the range \(f\in[\,(p_{k}-0.5)\frac{f_{s}}{N}\,,\,(p_{k}+0.5)\frac{f_{s}}{N}\,]\), a frequency \(\hat{f}\) that represents the signal frequency needs to be figured out to make Equation (15a) reach its maximum. Assume that a measured signal \(s(t)=\text{sin}(2\pi\times 100t)\), and the sampling rate and discrete signal sequence length are \(f_{s}=1000\) and \(N=4096\), respectively. The spectrum of this signal is shown in Figure 2(a). The index of maximum spectral line is \(p_{k}=410\) which represents the coarse frequency \(f_{coarse}=p_{k}f_{s}/N=100.098\) Hz. According to Equation (13), the real frequency is in the range \([99.976,100.220]\). Then, the trend of \(|X(f)|\) in Equation (15) in range \([99.976,100.220]\) can be calculated and shown in Figure 2(b). From Figure 2(b), it can be seen that in the region \([99.976,100.220]\), the \(|X(f)|\) has one maximum which represents the signal frequency. In order to find the estimated frequency value \(\hat{f}\) which satisfies the maximum constraint of Equation (15), particle swarm optimization (PSO) algorithm is used.