# Design and Development of an SVM-Powered Underwater Acoustic Modem
## 2 Materials and Methods
### Methodology and Data Analysis
The CWT analysis focused on the band between 150 kHz and 250 kHz, excluding features outside this band from the wavelet transform; see Figure 3 for a raw scalogram before the feature selection. The colors depicted in the scalogram correspond to the amplitude or strength of the wavelet coefficients at each time and frequency location, as indicated by the color bar to the right. In Figure 3, the vertical axis enumerates the frequency bins, where each bin represents a range of frequencies, with bin 1 corresponding to the lowest frequency range and higher bins corresponding to progressively higher ranges. These bins are integral to the feature extraction process, as they simplify the complex frequency spectrum into manageable segments for analysis by the SVM classifier. The \"Frequency Bin\" axis is thus a discrete index that correlates with specific frequency ranges defined by the CWT analysis, which, in this study, focused on the 150 kHz to 250 kHz band. The bins help to identify which portions of the signal spectrum are most relevant for classification and demodulation purposes. This categorization is crucial for machine learning applications, where input features must be distinctly identifiable and consistent across different instances of data. In the stage of preparing the dataset for supervised learning process, a meticulous labeling procedure was undertaken. The objective was to assign appropriate class labels to each of the extracted features from the CWT. Four distinct classes were chosen for labeling:  
* 1: Representing the symbol \"1\", which was transmitted at a frequency of 205.512 kHz. * 0: Representing the symbol \"0\", which was transmitted at a frequency of 185.675 kHz. * C: Initially intended to identify the clock, this symbol was later adapted to serve as a transitional symbol between \"1\" and \"0\", and its corresponding frequency was 195.487 kHz. This decision was influenced by the challenges faced during the transmitter design and the FPGA coding in Verilog, particularly concerning the spectrum leakage and the transition difficulties. Introducing the \"C\" symbol between \"1\" and \"0\" symbols provided flexibility in training the SVM, allowing the \"C\" to be trained as \"from 0 C\" or \"from 1 C\". * N: A generic class that represented all symbols that were neither \"1\", \"0\", nor \"C\". Then, the symbols \"1\", \"0\", and \"C\" were emitted at a different frequency each along 20 cycles (100 \(\upmu\)s for 200 kHz). Figure 4a,b depict the labeling process undertaken to train the SVM, showcasing the clear distinction between the classes, particularly emphasizing the \"C\" class. The numbers below Figure 4 represent the sample numbers, which corresponded to distinct time intervals of the modulated signal captured for the SVM classification. This numerical sequence facilitated an understanding of the temporal structure within the dataset. The labeling was executed within an Excel spreadsheet, which allowed for an organized and visual approach to this step. Each class was represented by a specific color code:  
Figure 4: Data labeling for training. (**a**) Zoomed-out view of the data labeling. (**b**) Detailed view of the data labeling. Numbers indicate samples. Figure 3: The 150 kHz to 250 kHz scalogram. * Red cells indicate the presence of the \"1\" symbol. * Blue cells denote the \"0\" symbol. * Yellow cells correspond to the \"C\" class. As indicated, this class acted as a transitional state in the modulation process and is instrumental to the method presented, ensuring a clear distinction between \"1\" and \"0\" in challenging demodulation scenarios. * Dark violet cells were tagged as \"N\" for any signal that did not correspond to the defined \"1\", \"0\", or \"C\" symbols. The choice of a color-coding scheme had a two-fold purpose: it expedited the labeling process and provided a quick visual reference to confirm the integrity of the labels applied to each sample.