## 3 PAI-Rife Algorithm
### PAI-Rife Algorithm  
Based on the contents of three subsections, A, B, and C, an improved algorithm is sorted out, namely the PAI-Rife algorithm. The proposed algorithm is divided into signal windowing, phase angle interpolation, and frequency shift optimization. The spectrum leakage, judgment of correction direction, and interpolation method are optimized, respectively. The calculation process of the PAI-Rife algorithm is given in Algorithm 1. ``` Input:

The operation process of the PAI-Rife algorithm is briefly described as follows:1. The Rife-Vincent (I) window is added to the signal, and an \(N\)-point DFT calculation is performed to obtain the signal spectrum. 2. Using the phase angle function to calculate the phase angle \(P_{1}\) corresponding to the maximum spectrum and the phase angles \(P_{2}\) and \(P_{3}\) corresponding to the adjacent two spectrums. 3. By comparing the sizes of \(P_{2}\) and \(P_{3}\), the correction direction \(r_{1}\) and the frequency deviation factor \(\delta_{1}\) are preliminarily determined. Assuming \(P_{2}=angle[F^{\prime}(k_{1}-1)]\), if \(P_{2}>P_{3}\), interpolation will be performed on the left of the maximum spectrum, at this time \(r_{1}=-1\). If \(P_{2}<P_{3}\), then the actual frequency point is considered to be on the right of the maximum spectrum, at this time \(r_{1}=1\). 4. A threshold decision is made on the frequency deviation factor \(\delta_{1}\). If \(0.15\leq\delta_{1}\leq 0.35\), the formula (10) is used to calculate the frequency. Otherwise, go to step 5. 5. The signal frequency is shifted by \(\delta_{k}\) quantized frequency units, and steps 2 and 3 are repeated to determine the correction direction \(r_{2}\) and the frequency deviation factor \(\delta_{2}\). The final frequency is calculated using Formula (14). ## 4 Simulation Analysis

### Experimental Methods

The MATLAB simulation platform is used to simulate and analyze the PAI-Rife algorithm. Computational complexity, mean, standard deviation, and misjudgment rate of correction direction are used as evaluation indicators to compare with Rife [15], CQRE [25], ASIQ-Rife [26], An-Rife [27] algorithms. Meanwhile, the mean and standard deviation of PAI-Rife are compared with other frequency domain estimation algorithms, such as HAQSE [21] and T-PP [22]. In the simulation process, additive white Gaussian noise with a mean of zero is added to the signal, and the CRLB is introduced as an index for estimation accuracy. The specific simulation parameters are shown in Table 1.

### Computation Complexity

It is known that the number of complex multiplications required by the Rife algorithm to perform an \(N\)-point FFT operation is

\[C_{M}=\frac{N}{2}\log(N), \tag{15}\]

and the number of complex additions is

\[C_{A}=N\log(N), \tag{16}\]

where, \(\log(\cdot)\) is the base 2 logarithmic operation. During the simulation, \(2N\) complex multiplications and \(2(N-1)\) complex additions are required to compute the maximal and submaximal spectra. The signal frequency shift also required \(N\) complex multiplications. In the PAI-Rife algorithm, the probability that the signal is frequency shifted is 40%. Therefore, the algorithm increased the computational quantity compared to the Rife algorithm by \(0.4(N+2N)=1.2N\) complex multiplications and \(0.4(2(N-1))=0.8(N-1)\) complex additions. The computation complexity of different Rife algorithms is shown in Table 2. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameters** & **Value** \\ \hline Monte Carlo times & 10,000 \\ Sampling points (\(N\)) & 1024 \\ Quantization frequency (\(f_{0}\)) & 19 Hz \\ Sampling frequency (\(f_{s}\)) & 1024 Hz \\ Frequency resolution (\(\triangle f\)) & 1 Hz \\ SNR & \(-\)10 dB:2 dB:10 dB \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters.