SE_PDI_LA β Phase Detection Indicator (PDI) Track Toolkit
SE_PDI_LA (code/SE/SE_PDI_LA.c, code/SE/SE_PDI_LA.h) is an interactive X11 widget ("PDI Track Toolkit", PDI_LA_widget) integrated into SE_WaterColumn and swathed. Developed by Leonardo (Leo) and John E. Hughes Clarke (October 2019), it extends the across-beam Bottom Detection Indicator (SE_BDI_DP) by incorporating high-resolution split-beam differential phase time series (.WC_Phase1 / .WC_Phase2, stored in WHOLE_ping_WCP) alongside water column amplitude (.watercol, WHOLE_ping_WC).
By fitting a linear phase ramp across adjacent receive beams around a candidate BDI amplitude peak at a fixed two-way travel time (TWTT) sliceβa technique termed Phase Detection Indicator (PDI)βSE_PDI_LA resolves sub-beam arrival angles at zero-phase crossings across constant-range arcs.
Architecture & X11 Widget Layout
make_PDI_LA_widget() initializes PDI_LA_widget (jX_widget) with 2 stacked 800Γ250 pixel graphics windows, 4 interactive sliders, and 4 toggle/action buttons:
Graphics Windows
- Graphic 0 (
draw_PDI_LA_AlongBeamβ Along-Beam Amplitude & Split-Beam Phase):- Plots a single receive beam (
selected_beaminselected_swath) over a zoomable TWTT sample window (selected_WC_TWTT - PDI_half_twtt_wintoselected_WC_TWTT + PDI_half_twtt_win). - Left vertical axis (
-180Β°to+180Β°): Plots raw split-beam differential phase (WHOLE_ping_WCP[0][swath].watercols[beam].ts_ampl[i]scaled to degrees) asGREENpolylines andREDsample crosses (show_PDI_Phase). - Right vertical axis (
-100to0dB): Plots acoustic backscatter intensity (0.5 * ts_ampl - 60dB) inBLUE(show_PDI_Int), with a verticalYELLOWcursor atselected_WC_TWTTand aMAGENTAmarker at the sonarβs real-time bottom detection sample (unknown).
- Plots a single receive beam (
- Graphic 1 (
draw_PDI_LA_AcrossBeamβ Across-Beam Constant-TWTT Phase & Amplitude Slice):- Plots both differential phase (
-180Β°to+180Β°) and intensity (-100to0dB) across receive beam pointing angles at the fixed range sliceselected_WC_TWTT(zoomed toselected_beam Β± PDI_half_beam_win). - Overlays candidate BDI amplitude peaks (
WC_BDI_pick[twtt][j].angle,CYANdiamonds) and the refined PDI zero-crossing phase picks (WC_PDI_pick[twtt][j].angle,REDdiamonds) along with the fitted linear phase regression slope across[left_limit, right_limit].
- Plots both differential phase (
Interactive Sliders & Control Buttons
| Control | Label | Range / Type | Backing Variable | Description |
|---|---|---|---|---|
Slider 0 | PDI threshold dB | -80.0 .. 10.0 | WC_PDI_threshold (int) | Minimum intensity threshold (dB) required when searching for valid phase samples around a BDI peak. |
Slider 1 | PDI ival (1) | -15.0 .. 15.0 | WC_PDI_ival (int) | Auxiliary tuning parameter for PDI window/gate control. |
Slider 2 | half beam win | 0.0 .. 50.0 | PDI_half_beam_win (int) | Half-width (in beam indices) of the across-beam zoom window in Graphic 1 (0 = full swath [-80Β°, +80Β°]). |
Slider 3 | half twtt win | 0.0 .. 300.0 | PDI_half_twtt_win (int) | Half-width (in TWTT samples) of the along-beam zoom window in Graphic 0 (0 = full range trace). |
Button 0 | plot Phase | Toggle | show_PDI_Phase | Toggles split-beam phase curves (GREEN/RED) in both graphics canvases. |
Button 1 | plot Int. dB | Toggle | show_PDI_Int | Toggles amplitude dB curves (BLUE) in both graphics canvases. |
Button 2 | show PDI-BDI | Toggle | show_PDI_BDI | Overlays BDI peak angles and PDI linear phase regression zero-crossings in Graphic 1 and the main SE_WaterColumn polar fan (plot_PDI). |
Button 3 | export frames | Action | PDI_export_frames() | Steps selected_WC_TWTT by 5 samples and exports synchronized PPM image pairs (pdi_%05d_%3d_%04d_slc.ppm and _pie.ppm) via dump_Window() (SE_3D.h). |
Core Algorithms (WC_PDI_pick_Angle_Peaks)
- BDI Seed Generation: Calls
standalone_BDI_pick_Angle_Peaks()(bdi_funcs.c) to populate up toNO_BDI(12) amplitude peaks per time slice inWC_BDI_pick[1500][NO_BDI]. - Across-Beam Phase Zero-Crossing Refinement: Calls
standalone_PDI_pick_Angle_Peaks()(pdi_funcs.c), which inspects the split-beam phase array (WHOLE_ping_WCP) in a neighborhood ([left_limit, right_limit]) around each BDI seedWC_BDI_pick[twtt][j].beam. It performs a least-squares linear regression of differential phase versus beam pointing angle ($\phi(\theta) = a + b\theta$) and solves for the zero-phase crossing angle $\theta_{\text{PDI}} = -a/b$, storing the result inWC_PDI_pick[twtt][j].angle. - Water Column Polar Fan Overlay: When
show_PDIandplot_PDIare active inSE_WaterColumn,draw_WaterColumn()projects every validWC_PDI_pick[i][j].angleinto across-track and depth coordinates and rendersREDdiamonds on the polar fan image.