# Design of an Underwater Acoustic Waveform and Integrated System for Communication and Detection
## 3 Hydroacoustic Integrated System Architecture
### Frequency and Phase Bias Estimation  
The two-step frequency and phase estimation and compensation method is employed, based on SS. It utilizes the preamble and the initial Data1 segment for frequency estimation and compensation, and then uses the frequency-compensated preamble and the Data1 SS for phase compensation and intra-frame compensation. The flowchart of this process is shown in Figure 11.  
The frequency and phase bias estimation and compensation method based on the proposed frame structure are described as follows. After frame detection, a coarse frequency offset estimate using the preamble is obtained using the maximum likelihood parallel carrier recovery algorithm. By performing autocorrelation on two adjacent and identical  
Figure 11: The proposed two-step frequency and phase estimation and compensation method. synchronization pilot (SP) sequences within the preamble sequence, we can obtain the phase difference between these two adjacent SP sequences. Since carrier frequency offset is the accumulation of phase difference of all SP sequences over time, a coarse estimate of the carrier frequency offset can be derived through the following calculations:  
\[f_{d1}=\frac{f_{s}}{2\pi N_{pre}}tan\left(\frac{Im\Big{[}\sum S_{pre}(n)S_{pre}^{ *}(n-N_{pre})\Big{]}}{Re\Big{[}\sum S_{pre}(n)S_{pre}^{*}(n-N_{pre})\Big{]}} \right)^{-1} \tag{23}\]  
where \(f_{s}\) is the carrier frequency, \(N_{pre}\) is the period of the SP sequence, and \(S_{pre}(n)\) is the \(n\)th code in one SP period. Using the Data1 symbol segment in the communication frame to complete the second step of frequency estimation, the multiplication estimation algorithm is utilized to calculate the second step frequency estimation value \(f_{d2}\). The baseband Data1 signal after the first step of frequency offset correction is  
\[X(kT_{s})=S_{Data1}(kT_{s})+n(kT_{s}) \tag{24}\]  
where \(n(kT_{s})\) is zero-mean Gaussian white noise and  
\[S_{Data1}(kT_{s})=exp\big{[}j\big{(}2\pi f_{d2}kT_{s}+\Delta\theta+\bar{\theta }\big{)}\big{]}\,Aexp[j\phi(kT_{s},I)] \tag{25}\]  
where \(f_{d2}\) is the residual frequency offset after coarse frequency offset correction, \(\Delta\theta\) is the frequency offset corresponding to the data symbol, and \(\hat{\theta}\) is the time-varying phase variation introduced by the channel. For the time-delay multiplication algorithm  
\[Z(kT_{s})=X(kT_{s})X^{*}[(k-D)T_{s}] \tag{26}\]  
where \(D\) is the delay, which is typically set to 1. Substituting (26) into (25) gives  
\[S_{Data1}(kT_{s})=A_{r}{}^{2}exp[j(2\pi f_{d2}kT_{s})]exp[j(\phi(kT_{s},I)- \phi((k-D)T_{s},I))]+N(kT_{s}) \tag{27}\]  
where \(N(kT_{s})\) is the zero-mean noise term. Taking the expected value gives  
\[E\big{\{}Z(kT_{s})\big{\}}=A_{r}{}^{2}A(kT_{s})exp[j(2\pi f_{d2}kT_{s})] \tag{28}\]  
where  
\[A(t)=E\big{\{}exp[j(\phi(kT_{s},I)-\phi((k-D)T_{s},I))]\big{\}} \tag{29}\]  
\(A(t)\) can be considered a constant independent of the frequency offset. The expected value over \(L_{0}\) symbols with \(N\) samples per symbol is  
\[E\Big{\{}\sum_{k=0}^{NL_{0}-1}Z(kT_{s})\Big{\}}=A_{r}{}^{2}NL_{0}\bar{A}exp(j 2\pi f_{d2}DT_{s}) \tag{30}\]  
where \(\overline{A}\) is the average of \(A(t)\). Then \(f_{d2}\) can be obtained from the phase as  
Figure 11:0  
In practice, this is estimated by taking the average  
Figure 11:1The next step is to perform frequency correction. Then, the preamble is extracted, and the phase shift \(\Delta\theta\) is obtained as  
Figure 11:2  
The Data1 block before and after phase correction is then used to obtain the phase difference \(\theta_{2}-\theta_{1}\). The phase variation is given by  
Figure 11:3  
After frame phase compensation, the estimation and compensation of the frequency and phase offsets are complete. The resulting communication signal is input to the Viterbi decoder to obtain the data.