Expand description
Nearest-point search in a finite set of complex points.
Slicer finds the point of a set nearest to a complex value: by rounding the
coordinates when the points form a regular square (QAM) or linear (PAM) grid, in
O(1) per value, and by exhaustive search otherwise. It knows nothing of symbols or
bit labels; the constellations of comnum-mapping and the decision-directed loops of
comnum-dsp build on it.
§Examples
use comnum_math::{nearest::Slicer, C64};
let s = Slicer::new(&[C64::new(-1.0, 0.0), C64::new(1.0, 0.0)]);
assert_eq!(s.nearest(C64::new(0.3, 2.0)), 1);
assert!((s.distance2(C64::new(0.5, 0.0)) - 0.25).abs() < 1e-12);Structs§
- Slicer
- Nearest-point search in a set of points: by rounding the coordinates on a regular square (QAM) or
linear (PAM) grid,
O(1)per sample, otherwise by exhaustive search.