# Real-Time Sea State Estimation for Wave Energy Converter Control via Machine Learning
## 4 Control Design
### Feature Extraction  
WEC parameters such as position (\(z\)), velocity (\(\dot{z}\)), and PTO force (\(F_{\text{PTO}}\)) exhibit small variations in changing wave period (\(T_{p}\)). Traditional time-domain approaches, such as statistical moments or signal amplitude variations, are insufficient in differentiating rapid and subtle changes in \(T_{p}\). Therefore, we incorporate frequency domain features and time-frequency representations to better capture variations in ocean wave dynamics. The Continuous Wavelet Transform (CWT) is a powerful tool for analyzing non-stationary signals by providing a joint representation in both time and frequency domains. Unlike the Fourier Transform, which decomposes a signal into pure sinusoids without time localization, CWT utilizes wavelets--localized basis functions--to capture transient and localized frequency variations [20]. Mathematically, the CWT of a signal \(x(t)\) is defined as  
\[W(a,b)=\int_{-\infty}^{\infty}x(t)\psi_{a,b}^{*}(t)\,dt \tag{21}\]  
where \(\psi_{a,b}^{*}(t)\) is the scaled and translated version of the mother wavelet \(\psi(t)\), given by  
\[\psi_{a,b}(t)=\frac{1}{\sqrt{|a|}}\psi\bigg{(}\frac{t-b}{a}\bigg{)} \tag{22}\]Here, \(a\) represents the scale parameter, which controls the frequency resolution, and \(b\) is the translation parameter, which determines the time localization of the wavelet. The choice of the mother wavelet affects the resolution and sensitivity of the transform. In this work, CWT is employed to extract time-frequency features from WEC measurements, enabling more accurate prediction of the wave period \(T_{p}\). The wavelet coefficients \(W(a,b)\) provide a multi-resolution analysis, capturing both high-frequency transient behavior and long-term variations. By integrating these features with the LSTM model, our system improves its ability to classify sea states despite small variations in \(T_{p}\). As shown in Figure 4, the first column presents the WEC position \(z(t)\) in the time domain for different wave periods \(T_{p}=2\), 3, and 4 s. The signals do not exhibit noticeable changes in amplitude or period at first glance. The second column displays the power spectral density (PSD), where a small variation in peak magnitude can be observed, particularly in the dominant frequency components. The third column represents the CWT-based time-frequency analysis, where distinct differences in wave energy distribution across time and frequency become evident. This highlights the advantage of using time-frequency representations in characterizing sea states, as CWT effectively distinguishes subtle changes in \(T_{p}\) that are not apparent in conventional time or frequency domain analyses. Several features are extracted from the WaveBot time-series data in the time domain and frequency domain. A list of features is shown in Table 2. To identify the \(n\)-best features from the WaveBot physical measurements, we introduce a composite \(z\)-score approach that integrates multiple feature evaluation metrics, providing a comprehensive measure of feature importance. Traditional feature selection methods often rely on a single criterion, which may overlook aspects of feature relevance or redundancy. Our composite \(z\)-score mitigates these limitations by combining multiple metrics, each capturing distinct aspects of feature importance. Figure 4: WEC position, \(z(t)\) for different \(T_{p}\) in time domain (**left** column), frequency domain (**middle** column), and time–frequency domain (**right** column). The composite \(z\)-score for each feature \(i\), denoted as \(z_{\text{composite},i}\), is defined as a weighted sum of normalized scores derived from multiple feature evaluation metrics. Let \(m\) be the number of feature evaluation methods included in the composite \(z\)-score, and let \(z_{ij}\) denote the normalized score for feature \(i\) under the \(j\)-th evaluation method.