# Generalized Chirp Spread Spectrum for Underwater Acoustic Communications
## 3 Generalized Chirp Spread Spectrum
To detect the energy, inner products are performed for each possible modulation combination, and the received energy \(\boldsymbol{E}\) is expressed as follows:\[\mathbf{E}= \begin{pmatrix}E_{1,1}&\dots&E_{1,m}&\dots&E_{1,M_{r}}\\ \vdots&\dots&\vdots&\dots&\vdots\\ E_{n,1}&\dots&E_{n,m}&\dots&E_{n,M_{r}}\\ \vdots&\dots&\vdots&\dots&\vdots\\ E_{M_{r},1}&\dots&E_{M_{r},m}&\dots&E_{M_{r},M_{r}}\end{pmatrix}  \tag{17}\]  
where \(E_{n,m}\) is calculated as follows:  
\[E_{n,m}=\frac{\sqrt{2}}{T_{sym}}\int_{0}^{T_{sym}}\cos\biggl{(}2\pi\biggl{(}f _{I,n}t+\frac{f_{r,m}-f_{I,n}}{2T_{sym}}t^{2}\biggr{)}\biggr{)}r_{k}^{*}(t)\,dt \tag{18}\]  
In Equation (18), \(*\) represents the complex conjugate of the received signal. Demodulation is performed by finding the index with the maximum energy among the energies calculated from Equations (17) and (18), and the index with the maximum energy is determined using the following equation. \[(\hat{n},\hat{m})=\arg\max_{n,m}E \tag{19}\]  
The demodulated bits (\(\hat{\mathbf{b}}_{k,l}\) and \(\hat{\mathbf{b}}_{k,r}\)) for the \(k\)-th received symbol are expressed as follows:  
\[\hat{\mathbf{b}}_{k,l} =\text{dec2 bin}(\hat{n}-1,\log_{2}M_{l}) \tag{20}\] \[\hat{\mathbf{b}}_{k,r} =\text{dec2 bin}(\hat{m}-1,\log_{2}M_{r}) \tag{21}\]  
where \(\text{dec2 bin}(a,b)\) is a function that converts the decimal value \(a\) to a binary number with \(b\) digits. To analyze the orthogonality of the G-CSS system, we calculate the inner product between the most similar symbols. Given modulation orders \((M_{l},M_{r})\), the most similar symbols are those with the same starting frequency but different ending frequencies that differ by one level. Consider two such adjacent symbols that can be expressed as follows:  
\[s_{1}(t) =\sqrt{2}\cos\Bigl{(}2\pi\Bigl{(}f_{l}t+\frac{\alpha_{1}}{2}t^{2} \Bigr{)}\Bigr{)}, \tag{22}\] \[s_{2}(t) =\sqrt{2}\cos\Bigl{(}2\pi\Bigl{(}f_{l}t+\frac{\alpha_{2}}{2}t^{2} \Bigr{)}\Bigr{)}, \tag{23}\]  
where \(f_{l}\) represents their common starting frequency, and \(\alpha_{1}\) and \(\alpha_{2}\) are frequency variation rates defined as \((f_{r,1}-f_{l})/T_{sym}\) and \((f_{r,2}-f_{l})/T_{sym}\), respectively, with \(f_{r,2}-f_{r,1}=\Delta f\) (one frequency level difference). The inner product over the symbol interval \([0,T_{sym}]\) is calculated to analyze the orthogonality between these adjacent symbols:  
\[I =\int_{0}^{T_{sym}}s_{1}(t)s_{2}(t)dt \tag{24}\] \[=2\int_{0}^{T_{sym}}\cos\Bigl{(}2\pi\Bigl{(}f_{l}t+\frac{\alpha_ {1}}{2}t^{2}\Bigr{)}\Bigr{)}\cos\Bigl{(}2\pi\Bigl{(}f_{l}t+\frac{\alpha_{2}}{ 2}t^{2}\Bigr{)}\Bigr{)}dt. \tag{25}\]  
Applying the product-to-sum formula for cosines, this can be expressed as follows:  
\[I=\int_{0}^{T_{sym}}\cos\Bigl{(}\pi(\alpha_{1}-\alpha_{2})t^{2}\Bigr{)}dt, \tag{26}\]  
where \((\alpha_{1}-\alpha_{2})\) is determined by the difference in ending frequencies \(\Delta f\). This integral takes the form of a Fresnel integral and approximates to \(\sqrt{T_{sym}/2}\). Due to the frequency level difference \(\Delta f\), the difference in chirp rates causes a rapid oscillation of the cosine function, resulting in the integral value approaching zero. This mathematical analysis demonstrates that the proposed G-CSS system ensures orthogonality even between the most similar adjacent symbols, thereby guaranteeing orthogonality for all symbol pairs in the system.