A crate for tracking relative position.
Relative position tracking is a common problem:
-
Mouse wheel (quadrature detection).
Here we are concerned with coarse granular angle, so a discrete relative position is sufficient. Using two phase shifted signals/sensors we can detect stepwise changes of direction.
-
Vinyl record (two phase shifted sinusoidal signals encoded as left/right stereo waveform). Hugely successful, "Digital Vinyl Systems" are widely used by both live DJs and in music production.
- Robust and accurate tracking
- Flexibility (you can replicate any sound/song even if not available on vinyl).
-
Well known tracking problem solution by phase unwrapping the two phase shifted signals.
-
Extremely robust, even under extreme condition.
- Octave (Matlab like tool). Rapid prototyping with visualization.
-
1-1 manual translation to Rust code, using the libm crate for high accuracy atan2 computations and rand for noise (with uniform distribution).
-
Visualization using the plotters crate.
-
Quality assessment and validation against golden model using csv.
Excellent correlation between Rust and octave implementations. libm atan2 claims to produce correct results even for angles near pi/2 or -pi/2 (that is, when x is near 0) and avoids spurious underflows.
This project is dual-licensed under MIT and Apache 2.0.