The tests/ (code/tests/) directory houses 28 standalone C utilities, physics simulators, numerical algorithm testbeds, and format-inspection tools authored primarily by John Hughes Clarke and collaborators (1992–2025). Throughout the development of the Ocean Mapping Group (OMG) software suite, code/tests/ has served as the proving ground where new acoustic models, signal-processing filters, coordinate rotations, and oceanographic formulas are prototyped and validated before being integrated into core libraries (liblocal.a, Echo_calib.c, j_watercolumn.c, DCM_rthand.c, ek80_parse_proc.c) and interactive applications (EKlook, DelayEditor, swathed).
Combines separate MATLAB ASCII exports of frequency (-xval), grazing angle (-yval), and backscatter (-zval) into 3D ASCII tables and OMG .r4 / .pack.r4 floating-point grids binned across grazing angle and frequency.
Computes cylindrical Bessel functions of the first kind $J_n(x)$ over $x \in [0, 10]$ via power-series expansion to a user-specified relative accuracy $\epsilon$, writing besselSeriesPlotn0.txt.
Generates synthetic Angular Response (AR) backscatter curves across grazing angle ($0^\circ\text{–}90^\circ$) and frequency ($10\text{–}400\text{ kHz}$) using either Jackson’s composite roughness/volume scattering model (-RG, do_RG_simple_model) or a parametric -BSn/-BSo/-Crossover model.
Generates a 36-frame sequence of OMG plotlib metafile plots (plot_001.meta–plot_036.meta) illustrating the effective two-way gain loss when transmit (Tx) and receive (Rx) beam patterns are angularly misaligned (shift).
C prototype of MacLennan’s (1981) & Rudgers’ (1967) modal series solution for the acoustic Target Strength ($\text{TS}$) of an elastic calibration sphere (e.g., $38.1\text{ mm}$ tungsten carbide) immersed in seawater.
Calls show_footprint(depth, beam_width, pulse_length) from Echo_calib.h to test ensonified beam-footprint vs. pulse-length geometry across a multibeam swath.
2. Chirp Waveforms, Matched Filtering & FIR Signal Processing
Simulates a vertical vessel heave profile composed of sinusoids (-sine) and step changes (-step), double-differentiates to acceleration, injects accelerometer bias (-bias), double-integrates back to drifted heave, and compares Hanning-weighted FIR detrending against FFT high-pass filtering.
Benchmarks complex $I/Q$ matched-filter norms ($L_2$ Euclidean/Frobenius via GSL gsl_blas_dznrm2, $L_1$ via gsl_blas_dzasum, and manual sum-of-squares) and compares direct time-domain complex convolution (cmplx_convolve) against radix-2 FFT/IFFT frequency-domain multiplication (four1).
Classifies 10-minute passive acoustic .wav spectral/filtered envelope time series (44.1 kHz base rate) by counting high-amplitude transient spikes per minute (-threshold, -aboveOK) and generating .wav.datetime epoch metadata files.
Evaluates seawater acoustic absorption (calc_atten in $\text{dB/km}$) as a function of temperature, salinity, depth, pH, and frequency across interactive prompts, $T\text{–}S$ look-up tables (-table), or full CTD water-column casts (-convert, -custom122 for EM122, -custom710 for EM710).
Standalone C source module implementing this_vchemilli(t, p, s) (Chen & Millero 1977 sound speed equation, containing a historical + pow(t,4) typo in term a3 later documented and fixed in testSV.c and two.c).
Interactive testbed for 3D Direction Cosine Matrix (DCM) coordinate transformations (DCM_rotate and DCM_unrotate from DCM_rthand.h), verifying vector length invariance between geographic (GEO) and vessel (SONAR) reference frames.
Estimates camera/vessel roll, pitch, and vertical pixel shift from left and right horizon edge-detection profile files using threshold crossing (-threshold) and focal-plane baseline geometry (-acrossdist, -alongdist, -pitchlevel).
Serial port listener (/dev/ttyd2) and binary packet decoder for 25-byte Motion Reference Unit ('q' header) frames containing 3-axis IEEE-754 floating-point angular orientations (angP, angR, angY) and linear accelerations (accelX, accelY, accelZ).
Interactive geodetic dead-reckoning calculator that projects a starting latitude/longitude (in decimal degrees or degrees/decimal minutes) along a given radial distance (meters) and azimuth ($0^\circ\text{–}360^\circ$).
Inspects 4-bit nibble-packed binary files, printing 32-bit and 8-bit binary representations (print32bits, print8bits) in verbose mode and masking the upper 4-bit nibble (onebyte & 240) to an output file.
Forensic binary file carver and string searcher; either scans raw disk/stream dumps for a target ASCII string (-string) and extracts printable text, or carves embedded Microsoft Office OLE2 Compound Documents (.doc, .ppt) by matching 32-byte header and 80-byte EOF signatures (-grab_microsoft).
Architecture diagnostic utility that prints INTEL vs. MOTOROLA endianness flags from swapio.h, C primitive type sizes (sizeof(long int), int, short, float, double), and 64-bit fseek/ftell file-length behavior.