# Underwater Target Recognition Based on Multi-Decision
## 3 LOFAR Spectral Line Enhancement Based on Multi-Step Decision
### Sliding Window Line Spectrum Extraction Algorithm Based on Multi-Step Decision  
In this section, a sliding window line spectrum extraction algorithm based on multi-step decision is used to search for the optimal path. As shown in Figure 5, in this algorithm, a window which can slide along the frequency axis and cover the whole time axis is set in the LOFAR spectrum. We search the optimal path in this window. The reason for setting the window is that there may be multiple line spectrum co-existing in the LOFAR spectrum. By properly setting the size of the window, the search range of the path can be limited to a certain region of the LOFAR spectrum. Then the line spectrum in each window can be extracted, which can avoid that only the strongest spectral line is extracted in the whole LOFAR spectrum. To cover a line spectrum in a search window, the size of the window is related to the line spectrum broadening and the frequency resolution in the LOFAR spectrum. The specific calculation steps are as follows:  
1. The length of the frequency axis in the LOFAR spectrum \(M\). The start point is \(f_{1}\), and the end point is \(f_{N}\). The length of the time axis is \(N\). The start point is \(t_{1}\), and the end points \(t_{N}\). The search window size is defined as \(L\). 2. Each point in the figure is defined as \(P_{i}^{j}\), representing the time-frequency pixel on the \(j\)th column on the frequency axis and the \(i\)th row on the time axis, where \(1\leq j\leq M\), \(1\leq i\leq N\). \(\eta_{p_{i}^{j}}^{*}\) represents the optimal path from \(t_{1}\) to \(t_{N}\) in the observation window, \(A(\eta_{p_{i}^{j}}^{*}),F(\eta_{p_{i}^{j}}^{*}),T(\eta_{p_{i}^{j}}^{*})\) defines as a set of ternary vectors for points \(P_{i}^{j}\), and the triplet of each point at \(t_{1}\) is initialized to \((a(P_{1}^{j}),0,0)\). 3. From \(t_{2}\) to \(t_{N}\), find the optimal path with length from 2 to \(N\) in the search window line by line. In the figure, \(P_{i}\) is set to any point in \(t_{1}\), the start position of the observation window is \(f_{k}\), and the corresponding end position is \(f_{k+L-1}\). At \(t_{i-1}\), the neighboring \(L\) points of \(P_{i}\) form a set as follows, \(V(P_{i})=\{P_{i-1}^{k},\cdots,P_{i-1}^{k+L-1}\}\), the optimal path \(\eta_{P_{i}}^{*}\) to the length \(i\) of the point \(P_{i}\) is obtained from the optimal path \(\eta_{p_{i}^{j}}^{*}\) of \(P_{i-1}^{j}\in V(P_{i})\), i.e., \(\eta_{P_{i}}^{*}=\eta_{P_{i-1}^{*}}^{*}\cup\{P_{i}\}\), where \(k\leq j\leq k+L-1\) satisfies: \[O(\eta_{P_{i}}^{*})=\underset{P_{i-1}^{j}\in V(P_{i})}{min}O(\eta_{p_{i-1}^{j }}^{*}\cup\{P_{i}\}),\] (26) \[j=\underset{P_{i-1}^{j}\in V(P_{i})}{argmin}O(\eta_{p_{i-1}^{j}}^{*}\cup\{P_ {i}\}),\] (27) where \(\{P_{i}\}\) represents the set of points \(P_{i}\). 4. At \(t_{N}\), the optimal path of the \(k\) points \(P_{N}^{j}\) in the search window is \(\eta_{P_{N}^{j}}^{*}\), where \(k\leq j\leq k+L-1\), then the optimal path of length \(N\) in the search window is: \[O(\eta*)=\underset{k<j\leq k+L-1}{min}O(\eta_{P_{N}^{j}}^{*}).\] (28)  
Figure 5: Frequency-domain sliding window multi-step decision dynamic tracking line spectrum. 5. Set a counter for each time-frequency point in the LOFAR spectrum, and the counter value is initialized to 0. If the value of the objective function \(O(\eta*)\) corresponding to the optimal path \(\eta^{*}\) in the search window is greater than the threshold \(\gamma\), we would consider that there is a line spectrum on the optimal path, and the counter values corresponding to the \(N\) points on the optimal path are increased by 1 respectively. The specific steps of threshold calculation are as follows: First, the input of the algorithm is changed from the LOFAR spectrum of ship radiation noise to the LOFAR spectrum of marine environmental noise.