Expand description
Source localization from arrival times.
This sans-I/O module solves for an event position from sensors at known Cartesian coordinates. Coordinates are metres in a caller-chosen 2D or 3D frame, times are seconds, and propagation speeds are metres per second.
§Measurement models
Absolute time of arrival (ToA) uses
t_i = t0 + ||x - s_i|| / c_i,with state [x, t0]: two or three position coordinates followed by the
origin time. Time difference of arrival (TDOA) uses
t_i - t_ref = ||x - s_i|| / c_i - ||x - s_ref|| / c_ref,with position-only state [x]. After a TDOA position solve, the origin time
is recovered from the absolute arrivals. Linear loss uses their arithmetic
mean exactly; a non-linear loss applies one iteratively reweighted refinement
so an arrival downweighted by the position solve is also downweighted in the
reported time.
Both modes require at least dimension + 1 sensors: three in 2D or four in
3D. The closed-form seed is the spherical-intersection linearization of
H. C. Schau and A. Z. Robinson, IEEE Transactions on Acoustics, Speech, and
Signal Processing 35(8), 1987, followed by a quadratic in the reference
range (TDOA) or emission-distance unknown c * t0 (ToA). See
closed_form_initial_guess.
The solution covariance is (J^T J)^-1 * timing_sigma_s^2, formed from the
retained singular vectors and values of the final Jacobian. At the fitted
state this is the local estimate covariance. source_crlb evaluates the
same timing-information interpretation at a proposed source point through
the shared DOP machinery, where it is a Cramer-Rao lower bound (CRLB).
By default locate_source also measures each sensor’s influence by running
one complete nonlinear leave-one-out solve per sensor. Each record reports
the full-solution ToA residual, held-out ToA residual, state displacement,
robust-loss weight, and normalized residual magnitude. Call
locate_source_with with a SourceLocateConfig whose
include_influence is false to skip those re-solves.
§Example
use sidereon_core::source_localization::{
locate_source_with, Sensor, SourceLocateConfig, SourceLocateOptions, SourceSolveMode,
};
let sensors = vec![
Sensor::new(vec![0.0, 0.0]),
Sensor::new(vec![100.0, 0.0]),
Sensor::new(vec![0.0, 100.0]),
Sensor::new(vec![100.0, 100.0]),
];
let source_m = [30.0, 40.0];
let origin_time_s = 2.0;
let propagation_speed_m_s = 50.0;
let arrival_times_s = sensors
.iter()
.map(|sensor| {
let dx = source_m[0] - sensor.position_m[0];
let dy = source_m[1] - sensor.position_m[1];
origin_time_s + (dx * dx + dy * dy).sqrt() / propagation_speed_m_s
})
.collect::<Vec<_>>();
let options = SourceLocateOptions {
mode: SourceSolveMode::Toa,
..SourceLocateOptions::default()
};
let mut config = SourceLocateConfig::from(options);
config.include_influence = false;
let solution = locate_source_with(
&sensors,
&arrival_times_s,
propagation_speed_m_s,
&config,
)?;
assert!((solution.position_m[0] - source_m[0]).abs() < 1.0e-8);
assert!((solution.position_m[1] - source_m[1]).abs() < 1.0e-8);
assert!((solution.origin_time_s.unwrap() - origin_time_s).abs() < 1.0e-10);Structs§
- Sensor
- A sensor with a known Cartesian position.
- Source
Covariance - Timing-information covariance for a source state.
- Source
Crlb - CRLB and DOP for a proposed sensor/source geometry.
- Source
Initial Guess - Closed-form seed used to start the iterative solve.
- Source
Locate Config - Full configuration for
locate_source_with. - Source
Locate Options - Options for
locate_source. - Source
Residual - One residual associated with a sensor row.
- Source
Sensor Influence - Per-sensor leave-one-out diagnostic.
- Source
Solution - Source solution from
locate_source.
Enums§
- Loss
- SciPy’s
lossselector forleast_squares. - Source
Localization Error - Source-localization failure.
- Source
Solve Mode - Measurement model used by
locate_source.
Functions§
- chan_
ho_ initial_ guess Deprecated - Deprecated name for
closed_form_initial_guess. - closed_
form_ initial_ guess - Compute the closed-form spherical-intersection seed used by
locate_source. - locate_
source - Locate a source from sensor arrival times.
- locate_
source_ with - Locate a source from sensor arrival times with a full
SourceLocateConfig. - source_
crlb - Compute a timing CRLB for a proposed source location.
- source_
dop - Compute timing DOP for a proposed source location.