# Wave processing

## Attenuation correction

Measuring waves using a pressure transducer requires attenuation correction to the raw signal so that the actual wave signal at the surface could be correctly reflected (Figure 1). According to linear wave theories, this could be achieved by Discrete Fourier Transform (DFT), since all wave signals could be considered as a composition of waves with different frequencies, and we can treat each frequency component separately (Figure 2).

Figure 1. Example to illustrate wave signal attenuated with depth (Wiki (1)).

Figure 2. Any realization of time record could be considered as the summation of many frequency components (Holthuijsen (2)).

The attenuation correction includes three major steps (Gibbons (3)).

1. Transform time-series data to its frequency domain.

2. Multiply each frequency by the inverse of the attenuation by that particular frequency due to the depth of the instrument. This action is limited to attenuation <1/20 to avoid injecting noise into the reconstruction.

3. Transform the corrected frequency back to the time domain using the inverse Fourier transform .

## Windowing

When applying the Fourier Transform to time series data, the underlying assumption is that the two endpoints of a time waveform are connected together and if an integer number of periods fill the acquisition time interval, the transform turns out fine. However, in reality, this could never be the case. When the measured signal is not an integer number of periods, the endpoints are discontinuous. The artificial discontinuities appear as high-frequency components not present in the original signal after DFT. This is known as spectral leakage. To minimize the effect, the windowing technique is introduced (Figure 3). There are many different types of window functions that could be applied depending on the signal. In general, the Hann window is satisfactory in 95 percent of cases. Ruskin applies a 96-point Hann window to the first 48 and the last 48 samples of each burst before DFT. Once the frequency signal after attenuation correction is transformed back to the time domain, an inverse Hann window is applied (Earle (4)).

Figure 4. Example to illustrate how windowing minimizes spectral leakage (Siemens (5)).

## Procedures implemented in Ruskin software

### Transforming the data

1. Find the linear regression of the burst data.

2. Find the “mean depth”, which is the depth at the middle of the burst calculated by the linear regression.

3. Remove mean depth and detrend the burst data.

4. Apply a Hann window on the burst data (window size 96 samples) to provide hdata.

5. Apply a 1D real-only DFT on hdata to provide fdata.

6. Find max frequency in fdata, which is either the largest frequency or the largest frequency that can be detected without aliasing (Nyquist).

7. Remove frequencies higher than max frequency and conjugate aliases in fdata.

8. Apply attenuation-correction to each frequency in fdata.

9. Determine principle frequency.

10. IDFT fdata to provide ifdata.

11. Inverse the Hann window on ifdata to provide ihdata.

### Calculating the statistics based on ihdata

1. Calculate variance (see Mobley (6)).

2. Calculate energy = variance * gravity * density * 1000.0.

Default gravity = 9.80665m/s2
Default density = 1.0281kg/m3

3. Determine negative-to-positive zero crossings in time domain, ignoring the first partial wave (and dropping the last partial wave).

4. Calculate average period = sum(periods) / n.

5. Calculate average height = sum(heights) / n.

6. Rank sort waves by height.

7. Determine max height and max period.

8. Calculate significant height and period on the largest 1/3 of the waves.

9. Calculate 1/10 height and period on the largest 1/10 of the waves.

## References

1. Image. https://en.wikipedia.org/wiki/Wind_wave (accessed Feb 17, 2022).

2. Holthuijsen, Leo H., Waves in Oceanic and Coastal Waters, 2007. Waves-in-Oceanic-and-Coastal-Waters (accessed Feb 17, 2022).

3. Gibbons, D. T., G. Jones, E. Siegel, A. Hay, and F. Johnson,  Performance of a new submersible Tide-Wave recorder, Oceans, 2005. Proceedings of MTS/IEEE, vol. 2, pp. 1057–1060, IEEE, New York, doi:10.1109/OCEANS.2005.1639895. Performance of a new submersible Tide-Wave recorder (accessed Feb 17, 2022).

4. Earle, M. D. Nondirectional and Directional Wave Data Analysis Procedures; NDBC Technical Document 96-01, Slidell, Louisiana; 1996. Nondirectional and Directional Wave Data Analysis Procedures (accessed Feb 17, 2022).

5. Siemens/Testing, Windows and Spectral Leakage. https://community.plm.automation.siemens.com/t5/Testing-Knowledge-Base/Windows-and-Spectral-Leakage/ta-p/432760 (accessed Feb 17, 2022).

6. Mobley, C. Wave Energy.  wave-variance-spectra-theory (accessed Feb 17, 2022).

JavaScript errors detected