simrad_tvg — Kongsberg Simrad EM Backscatter TVG & BTS De-Ramping Interface
Overview & Purpose
The simrad_tvg module (code/subr/simrad_tvg.h and code/subr/simrad_tvg.c) defines the data structures and function prototypes for reconstructing and removing the real-time Time-Varying Gain (TVG) and Bottom Target Strength (BTS) backscatter corrections applied by Kongsberg (Simrad) EM-series multibeam echosounders (.all and .kmall formats).
Originally developed by Jonathan Beaudoin (2007–2011) and extended by Anand Hiroji (2013–2015) and John Hughes Clarke (2022–2024), the module models Kongsberg’s three-segment real-time backscatter law across one-way travel time (owtt):
- Water Column Domain (
WC_Spec_Lamb == 1): Before normal incidence (owtt < owtt_to_normal_incidence), where beamwidth-limited spreading applies. - Specular / Nadir Ramp Domain (
WC_Spec_Lamb == 2): Between normal incidence and the TVG crossover angle (owtt_to_normal_incidence <= owtt < owtt_to_crossover), where Kongsberg transitions from normal-incidence backscatterBSnto oblique backscatterBSousing a $\sqrt{t - 1}$ ramp to suppress the specular nadir peak. - Lambertian Domain (
WC_Spec_Lamb == 3): Beyond the crossover range (owtt >= owtt_to_crossover), where a flat-seafloor $\cos^2\theta$ Lambertian law aroundBSoand a pulse-length-limited ensonified area are assumed by the sonar in real time.
Implementation Note: In the current UNB SwathEd source tree,
code/subr/simrad_tvg.ccontains only the global variable definitionint has_snippet;(while the full header contract remains incode/subr/simrad_tvg.hforSE_AnandBS.c,ensonification.h,newGetBP.c,understand_KM_BS.c, anddeTVG.c).
Key Data Structures
simrad_TVG (simrad_tvg.h)
typedef struct simrad_TVG {
/* Pulled directly from OMG data structures */
float BSn;
float BSo;
float range_to_normal_incidence;
int used_sample_rate;
float crossover_angle;
float tx_beamwidth, rx_beamwidth;
float sound_speed;
float pulse_length;
/* Computed when above are loaded */
float crossover_range;
float owtt_to_normal_incidence;
float owtt_to_crossover;
/* Housekeeping flags controlling BTS computation */
int try_new_BTS;
int try_new_BTS_per_beam;
int try_only_pulse_length_correction;
} simrad_TVG;
BS_data (simrad_tvg.h)
Per-beam backscatter and snippet sample workspace structure:
- Metadata & Angles:
memory_allocated,no_of_samples,unique_sector,Beam_status,centre_sample_no,grazing_angles,sonar_relative_angle,Verticaly_Referenced_Angle,rx_beamwidth,pulse_length,owtt_to_centre_sample,WC_Spec_Lamb(1= water column,2= specular domain,3= Lambertian domain). - Dynamic Sample Arrays:
float *original_BS: Raw snippet/beam backscatter intensities (dB) as recorded by the Kongsberg sonar.float *BTS: Reconstructed Kongsberg real-time Bottom Target Strength correction (dB) per sample.float *BSn_BSo: Isolated near-nadirBSn-to-BSoramp suppression term (added March 2024).float *BS: Predicted Kongsberg backscatter coefficient (BTS + BSo).int *ensoni_area_descriptor: Flag indicating how area was calculated (0= pulse-length limited,1= beamwidth limited,2= none).float *ensoni_area: True slope-corrected ensonified area ($10 \log_{10} A$) computed from actual seafloor grazing angle.float *ensoni_area_flat_seafloor: Flat-seafloor ensonified area ($10 \log_{10} A_{\text{flat}}$) assumed by the Kongsberg real-time processor.float *deTVG_BS: Final de-ramped and true-area-normalized backscatter (original_BS + BTS - ensoni_area).double *owtt: One-way travel time (seconds) for each snippet sample.
Public Functions & Signatures
int get_TVG_params(OMG_HDCS_profile_header *profile, simrad_TVG *tvg)ExtractsBSn,BSo(fromprofile->BSn_f/BSo_forprofile->TVGandprofile->power),range_to_normal_incidence,crossover_angle(profile->tvg_crossover),tx_beamwidth,rx_beamwidth,sound_speed, andpulse_length(supporting both legacy.alland.kmallmaxEffTxPulseLength_sec), and computescrossover_range,owtt_to_normal_incidence, andowtt_to_crossover.int print_TVG_params(simrad_TVG *tvg)Prints a formatted diagnostic summary of all fields in asimrad_TVGstruct.void compute_BTS(int k, simrad_TVG *tvg, BS_data *a_BS_data)Evaluates the Kongsberg real-timeBTS,BSn_BSo,WC_Spec_Lamb, andensoni_area_flat_seafloorat sample indexk(supporting both legacytry_new_BTS == 0and moderntry_new_BTS == 1formulations).int adh_take_out_BTS_and_correct_for_area(int k, simrad_TVG *tvg_array, int do_pulse_length_correction, BS_data *a_BS_data)Removes the Kongsberg real-timeBTSand flat-seafloor area assumption fromoriginal_BS[k]and normalizes by the true grazing-angle-dependent ensonified area (calculate_ensonified_area_ADH), storing the result indeTVG_BS[k].double adh_find_range_to_center_sample(unsigned int range, OMG_HDCS_profile_header *profile)Rescales a beam’s two-way range from the bathymetry sampling rate (profile->samp_rate) to the seabed image sampling rate (profile->snippet_sample_rate) when they differ (e.g., EM2040 multi-mode operation).float adh_find_sector_pulse_length(OMG_HDCS_tx_sector *tx_sectors, unsigned char TxSector)Returns the effective transmit pulse length for sectorTxSector:signal_lengthfor CW pulses (waveform_id == 0) or compressed pulse length1.0 / signal_bandwidthfor FM chirp pulses (waveform_id == 1or2).int adh_get_OWTT_for_each_sample(...)/int adh_get_OWTT_for_each_sample_from_twtt(...)Computes the one-way travel timea_BS_data->owtt[k]for samplekrelative to the beam center detection sample, accounting for pre-EM710 (has_snippet == 1) vs. post-EM710 (has_snippet == 0) snippet sample spacing.int adh_get_RX_beamwidth(simrad_TVG *tvg, BS_data *a_BS_data)Computes the steered receive beamwidth broadened by the sonar-relative steering angle:tvg->rx_beamwidth / cos((90.0 - sonar_relative_angle) * M_PI / 180.0).int adh_recalc_range_to_normal_incidence(OMG_HDCS_profile_header *profile, OMG_HDCS_beam *beams)Recomputesprofile->range_to_normal_incidenceas twice the minimum valid beamrangeacross the swath.int recalc_owtt_normal_incidence_crossover(simrad_TVG *tvg, OMG_HDCS_beam *beams, int nobeams)Overridestvg->owtt_to_normal_incidenceandtvg->owtt_to_crossoverusing floating-point beamtwttvalues (added March 2024 for.kmallprecision).int adh_allocate_memory_for_BS_data(int no_samples, BS_data *a_BS_data)/int adh_free_memory_for_BS_data(BS_data *a_BS_data)Allocates and frees the dynamic sample arrays inside aBS_datastruct.
How It Fits Into the OMG Architecture
- Interactive Backscatter & Water Column Analysis (
SE/SE_AnandBS.c,SE/SE_WaterColumn.c):SE_AnandBS.cusessimrad_TVGandBS_datato interactively inspect and de-TVG Kongsberg multibeam backscatter in SwathEd. - Beam Pattern & Backscatter Calibration (
omg/newGetBP.c,omg/understand_KM_BS.c,jonnyb/gom_stuff/deTVG.c,subr/ensonification.h): Rely onsimrad_tvg.hstructures and routines to strip Kongsberg’s real-timeBSn/BSoramp and flat-seafloor area assumptions so true angular response and transmit/receive beam patterns can be recovered.