## 3 Method
### Waveform Retracking Method
#### 3.2.3 Non-Specular Echo Processing  
Non-specular waveforms are the main processing objects in this study, the leading edge and the trailing edge of the non-specular waveforms are disposed of in different ways. For the leading edge, a rough leading edge is identified by the 'normal ending gate' and the 'possible ending gate' of the leading edge. Then, the reference ending power of the leading edge is provided from the reference gates to obtain an accurate leading edge that contains less noise. For the trailing edge of the waveform, a steady attenuation part of the trailing edge is searched for as the effective trailing edge, and the tail of the trailing edge is taken as the supplement. The results are obtained by fitting the processed leading edge and effective trailing edge with the WLS4 and then picking the sharpening waveforms out by the mispointing angle to refit by the MB4. * Confirming the main part of waveform  
Coastal waveforms sometimes have several continuous noise gates around the beginning of the leading edge, which is avoided by confirming the main part of the waveform in this study. All gates with power exceeding a threshold are screened out, and then the widest part is taken as the main part of the waveform and searched backward to find the starting gate. The first gate with increasing power serves as the starting gate of the main part of the waveform. The threshold is an empirical value taken as 0.35 in this study. It is necessary to determine the main part of the waveform. When the satellite nadir approaches the coast, the general leading edge forward search method has a false detection of the leading edge or contains noise information in the leading edge. If the beginning and  
Figure 4: Flow diagram of coastal waveform retracking procedure of HY-2B altimetry. the end of the leading edge are both affected by coastal 'pollution', SWH retrieval will be extremely inaccurate. * Leading edge processing Generally, the ideal leading edge has the following characteristics: the power of the leading edge increases from fast to slow, and the growth rate is largest at the midpoint of the leading edge; the power growth rate is zero at the end of the leading edge, and then the power of the echo starts decreasing. Therefore, the top-power gate of the waveform is often thought to be the ending gate of the leading edge. The detection of the leading edge in this study includes rough leading edge detection and accurate leading edge detection. For rough leading edge detection, the first power-decreasing gate after the beginning of the waveform main part is taken as the 'normal ending gate of the leading edge (NEG)' if the power of the NEG is higher than the next gate by more than 0.12; otherwise, the search for the NEG continues forward. In addition, two special types of gates before the NEG are taken as the 'possible ending gate of the leading edge (PEG)' for the rough leading edge. The first type of PEG is a gate with high power, but the increasing power suddenly slows down, as shown in Figure 5. The second type of PEG is a gate with a power slightly larger than that of the next gate, as shown in Figure 6. Both kinds of PEG indicate the coastal influence on the leading edge and are meaningful to the detection of the leading edge. The absolute power difference between the PEG and the next gate is less than 0.08, and there is only one NEG and no more than one PEG for a single waveform. Figure 5: Examples of the first kind of “possible ending gate of leading edge”, the \(x\)-axis is the number of gate and the \(y\)-axis is the normalized power of echo. The blue line is whole waveform, the red line is the leading edge depending on the “normal ending gate of leading edge”, the marked yellow gate is the first kind of “possible ending gate of leading edge” with increasing power. Figure 6: Examples of the second kind of “possible ending gate of leading edge”, the \(x\)-axis is the number of gate and the \(y\)-axis is the normalized power of echo.