# Asynchronous Chirp Slope Keying for Underwater Acoustic Communication
## 2 Materials and Methods
### Demodulation
#### 2.4.4 Frame Detect & Downsample  
The FDDS block first estimates the frame positions in half symbol space, then uses this information to estimate the symbol phase of each frame and downsample it to full symbol space. First, we assume a known symbol length \(N_{\text{ch2}}\) from the reference chirp sequence and estimate it simply to  
\[N_{\text{ch2}}=\left\lfloor\frac{T}{f_{\text{s2}}}\right\rfloor=\left\lfloor \frac{N_{\text{ref}}}{f_{\text{s1}}}\right\rfloor. \tag{27}\]  
The mean magnitude of each of the \(M_{\text{H}}\) half symbol frames of length \(N_{\text{H}}\), where  
\[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]  
is then calculated by only regarding the superposed pulses of both channels, which guarantees the presence of an autocorrelation peak in each symbol. Therefore, we calculate \[y_{\text{ms}}[m] =\sum_{n}^{N_{\text{H}}}y_{\text{sum}}[n+(m-1)]\,N_{\text{H}},\quad \text{where} \tag{29}\] \[m\in [1,\,M_{\text{H}}],\] \[M_{\text{H}} =\left\lfloor\frac{N_{\text{Jds}}}{N_{\text{H}}}\right\rfloor,\]  
which reduces strong magnitude fluctuations before the data frame detection and resamples the sequence to half symbol space. As the envelope detection is very sensitive to non-steady slopes, we apply an additional 10 th order lowpass filter  
\[y_{\text{mLP}}=\text{LPF}\{y_{\text{ms}}\}, \tag{30}\]  
with an estimated cutoff frequency  
\[\omega_{\text{MLP}} =\frac{m_{\text{MLP}}}{M_{\text{H}}},\quad\text{where} \tag{31}\] \[m_{\text{MLP}} =\arg\max\{|\text{FFT}\{y_{\text{ms}}\}|\}.\]  
The frame detection algorithm has two parts. Initially, a threshold is calculated for the whole received sequence of each channel, then a state machine iterates through it and extracts frame start and end times. We estimate the threshold \(y_{\text{th}}\) by a simple clustering, that first calculates the mean amplitude of the lowpass filtered half symbol magnitude  
\[\tilde{y}_{\text{mLP}}=\text{mean}\{y_{\text{mLP}}\}, \tag{32}\]  
then calculates the cluster means for both sides of the mean level,  
\[\tilde{y}_{\text{mS}} =\text{mean}\{y_{\text{mLP}}[y_{\text{mLP}}>\tilde{y}_{\text{mLP }}]\}, \tag{33}\] \[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]0  
where the lower mean value \(\tilde{y}_{\text{mN}}\) is considered the noise level and the upper mean \(\tilde{y}_{\text{mS}}\) the signal level. The threshold is then simply the arithmetic mean of those two levels  
\[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]1  
Subsequently, the state machine iterates through the sequence \(y_{\text{mLP}}\) and records an upwards slope if there are \(M_{\text{HL}}\) of samples below the threshold \(y_{\text{mTh}}\) followed by \(M_{\text{HH}}\) samples above it. We set both intervals as \(M_{\text{HL}}=M_{\text{HH}}=2\), limiting the miminal frame size to \(M_{\text{HL}}+M_{\text{HH}}-1=3\) samples. A state variable will keep track if the iteration is inside a frame and stores start index \(m_{0}[p]\) and end index \(m_{1}[p]\) of each \(p\)th frame. The frame limits are then reconstructed in sample space through scaling the indice by \(M_{\text{H}}\),  
\[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]2 \[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]3  
The single frames in sample space are then defined as  
\[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]4 \[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]5 \[N_{\text{H}}=\left\lfloor\frac{N_{\text{ch2}}}{2}\right\rfloor, \tag{28}\]6  
where \(y_{\text{sum}}\) and \(y_{\text{div}}\) are the two sub-arrays of \(y_{\text{Jds}}\) and include all \(N_{\text{lo}}\) channels as an additional dimension, respectively. The indexing of the channel dimensions has been omitted for ease of reading.