# Asynchronous Chirp Slope Keying for Underwater Acoustic Communication
## Appendix A  
```
input :\(f_{0}\) start frequency, \(T\) length of chirp in seconds, \(f_{1}\) end frequency, \(f_{\rm s}\) sampling frequency. output :\(y\) 1-D vector containing a real-valued linear chirp sequence // Translate frequency input into relative frequencies:
1\(\omega_{0}=2\cdot\pi\cdot f_{0}/f_{\rm s}\);
2\(\omega_{1}=2\cdot\pi\cdot f_{1}/f_{\rm s}\);
3// Prepare sample time:
3\(N=\lfloor T\cdot f_{\rm s}\rfloor\);
4\(n=0\colon(N-1)\); // Calculate the shaping window
5\(y_{\rm w}=\text{tukey}(N,\,0.5)\); // The discrete sampled time limited chirp signal is calculated as follows:
6\(k=(\omega_{1}-\omega_{0})/2\cdot N_{\rm ch}\);
7\(\omega=\omega_{0}+k\cdot n\); // Furthermore, lastly the shaping function is simply superposed:
8\(y=y_{\rm w}\cdot sin(\omega\cdot n)\);
```  
**Algorithm A1**Linear Chirp Generation. ```
input :\(N\) length of window in samples, \(a\) taper fraction. output :\(y\) 1-D vector containing a real-valued window sequence // Prepare taper thresholds:
1\(N_{\rm th}=\lfloor a\cdot(N/2-1)\rfloor+1\); // Calculate 1 st leg: Up slope \(n_{\rm I}=0\colon(N_{\rm th}-1)\);
3\(y_{\rm I}=(1-\cos(n_{\rm I}\cdot\pi/(N_{\rm th}-1)))/2\); // Calculate 2 nd leg: Flat top \(n_{\rm II}=N_{\rm th}\colon(N-N_{\rm th}-1)\);
4\(y_{\rm II}=\text{ones}(1,\,\text{length}(n_{\rm II}))\); // Calculate 3 rd leg: Down slope \(N_{\rm off}=(N-1)\cdot(1-a/2)\);
5\(n_{\rm III}=(N-N_{\rm th})\colon N\);
6\(y_{\rm III}=(1-\cos((n_{\rm III}-N_{\rm off})\cdot\pi/(N_{\rm th}-1)))/2\); // Join legs:
7\(y=[y_{\rm I},\,y_{\rm II},\,y_{\rm III}]\);
```  
**Algorithm A2**Partially Constructed Tukey Window. ```
input :\(y_{\text{rbb}}\) real-valued 1-D base-band chirp sequence, \(\omega_{\text{ch}}\) side-band center frequency offset relative to \(f_{\text{s}}\), \(\omega_{\text{lo}}\) array of relative mixing frequencies, \(B_{\text{w}}\) relative bandwidth of sidebands (scalar), \(b_{\text{sb}}\) boolean switch for side-band choice. output :\(y_{\text{ref}}\) array containing up-converted real-valued linear chirp sequences // Switch to frequency bin space:
1\(N_{\text{ref}}=\text{length}(y_{\text{rbb}})\);
2\(N_{\text{lo}}=\text{length}(\omega_{\text{lo}})\);
3\(n_{\text{B}}=\left\lfloor B_{\omega}\cdot N_{\text{ref}}\right\rfloor\);
4\(n_{\text{ch}}=\left\lfloor\omega_{\text{ch}}\cdot N_{\text{ref}}\right\rfloor\);
5\(n_{\text{lo}}=\left\lfloor\omega_{\text{lo}}\cdot N_{\text{ref}}\right\rfloor\); // Calculate frequency limit bins of the input signal:
6\(n_{\text{in}}(1,\,;)=n_{\text{ch}}+[-n_{\text{B}},+n_{\text{B}}]\);
7\(n_{\text{in}}(2,\,;)=N_{\text{ref}}-n_{\text{in}}(1,\,;)\);
8\(Y_{\text{rbb}}=\text{FFT}\{y_{\text{rbb}}\}\);
9 for\(c=1:N_{\text{lo}}\)do
10 if\(b_{\text{sb}}\)then
11\(n_{\text{out}}(1,\,;)=n_{\text{lo}}(c)+[n_{\text{in}}(1,\,1),\,n_{\text{in}}(1, \,2)]\);
12 else
13\(n_{\text{out}}(1,\,;)=n_{\text{lo}}(c)-[n_{\text{in}}(1,\,1),\,n_{\text{in}}(1, \,2)]\);
14\(n_{\text{out}}(2,\,;)=N_{\text{ref}}-[n_{\text{out}}(1,\,1),\,n_{\text{out}}(1, \,2)]\); // Assemble bin vectors:
15\(\vec{n}_{\text{in}}= \begin{bmatrix}n_{\text{in}}(1,\,1):n_{\text{in}}(1,\,2) \\ n_{\text{in}}(2,\,2):n_{\text{in}}(2,\,1)\end{bmatrix} \);
16 if\(b_{\text{sb}}\)then
17\(\vec{n}_{\text{out}}= \begin{bmatrix}n_{\text{out}}(1,\,1):n_{\text{out}}(1,\,2 )\\ n_{\text{out}}(2,\,2):n_{\text{out}}(2,\,1)\end{bmatrix} \);
18
19 else
20\(\vec{n}_{\text{out}}= \begin{bmatrix}n_{\text{out}}(1,\,2):n_{\text{out}}(1,\,1 )\\ n_{\text{out}}(2,\,1):n_{\text{out}}(2,\,2)\end{bmatrix}