# Underwater Acoustic Signal LOFAR Spectrogram Denoising Based on Enhanced Simulation
## 2 Materials and Methods
### Training Data Simulation Method
\(U=\left[0,0,\ldots,0\right]\)//Initialize the signal with duration T seconds Procedure: for i =1 to N do \(f=\) random(\(f_{l},f_{h}\)) //Random center frequency value \(A=\) random(\(A_{l},A_{h}\)) //Random signal amplitude value \(\phi=\) random(\(0,\pi\)) //Random initial phase for j = 1 to \((f_{s}\cdot T)\)do//Signal duration of T seconds if j \(\mod f_{s}=0\)then \(r_{n}=random(0,1)\) //Random value controlling direction if\(r_{n}\geq 0.5\)then \(\delta=1\) //Random walk direction else \(\delta=-1\) //Random walk direction endif \(f=f+\delta\cdot f_{d}\)//Frequency random walk \(A=A+\delta\cdot A_{d}\) //Amplitude random walk \(U[j]=U[j]+A\cdot\sin(2\pi ft[j]+\phi)\)//Simulate one second data endif endfor endfor
```  
**Algorithm 1** Time-Domain Underwater Acoustic Target Data Simulation Algorithm  
Based on the simulation method, the time-domain acoustic signal of underwater target can be simulated. Due to the difference in average power between the simulated underwater target signal and the average power of the ocean noise, it is necessary to consider the impact of power when merging the simulated target signal with the ocean noise. This will ensure that the final simulated data can cover various signal-to-noise ratio conditions. The signal-to-noise ratio of a known signal is defined as:  
\[SNR=10\log_{10}\left(\frac{P_{\text{target}}}{P_{\text{noise}}}\right)=20\log_{ 10}\left(\frac{A_{\text{target}}}{A_{\text{noise}}}\right) \tag{6}\]  
where \(P_{\text{target}}\) is the power of the target signal, \(P_{\text{noise}}\) is the power of the noise, \(A_{\text{target}}\) is the amplitude of the target signal, and \(A_{\text{noise}}\) is the amplitude of the noise. According to Equation (6), to obtain an accurate numerical value for the signal-to-noise ratio, the ratio of the amplitudes of the target signal to the noise should be adjusted, thus the adjustment coefficient \(coef\) is defined as:  
\[\text{coef}=e^{\frac{SNR_{\text{target}}-20\log_{10}\left(\frac{A_{\text{ target}}}{A_{\text{noise}}}\right)}{20}} \tag{7}\]  
where \(SNR_{\text{target}}\) is the target signal-to-noise ratio from the simulation data. Thus, the final time-domain simulation signal \(S\) can be defined as:  
\[S=coef\times U+Noise \tag{8}\]  
where \(Noise\) is the time-domain signal of ocean environmental noise. Based on above simulation methods and processes, the time-domain signal with an exact signal-to-noise ratio can be simulated, and the LOFAR spectrogram can be obtained through short-time Fourier transform as model input. In the training of the convolutional denoising model, not only input sample data is required, but also corresponding label samples. The aforementioned samples are obtained based on the simulation methods, so the label of the signal are also known. Additionally, since the denoising model operates on the LOFAR spectrogram, its label are presented in the form of spectrograms, which include a time-frequency representation with target-only line spectrum defined in Equation (9) and noise only spectrogram defined in Equation (10). \[Mask_{target}=\frac{||STFT(U)||}{||STFT(U)||+||STFT(Noise)||} \tag{9}\]  
\[f^{\prime}=\frac{(v\pm v_{0})}{(v\mp v_{s})}f \tag{2}\]0  
where \(Mask_{target}\) represents the soft threshold mask label for the target, \(Mask_{noise}\) represents the soft threshold mask label for the noise, and \(STFT(\cdot)\) represents the short-time Fourier transform.