Tool · Phase-space distance · v1.0
How different are
two signals? Look at their shape in phase space.
Time-delay embedding turns each signal into a trajectory. CPST measures how far the test trajectory drifts from the reference on average; the percentile Hausdorff distance finds the largest local gap. Everything below runs in your browser.
Try it Python packageaverage distortion of the test trajectory
largest local gap, robust to outliers
worst single gap (q = 100)
delay τ, dimension m, points per trajectory
01 / Input
Choose two signals and the parameters
Start with a mock pair, a two-tone wave whose trajectory is a clean knot, so you can see each change directly. Or upload your own reference and test signals as CSV files.
02 / Embed
Three samples, one point: the signal becomes a trajectory
Each point of the trajectory is X(n) = [x(n), x(n+τ), x(n+2τ), …]. Move the slider: the three marked samples on the left are the coordinates of the highlighted point on the right. Both signals use the same τ and m.
03 / CPST
Change in Phase Space Topology: the average drift
For every test point, average its k nearest reference points into a centroid and measure the gap. CPST is the mean gap over the whole trajectory, so it responds to changes that are spread over the signal.
- Pick a test point sᵢ on the pink trajectory (slider below).
- Find its k nearest reference points (black dots) and average them into a centroid r̄ᵢ (white diamond).
- Measure the gap Eᵢ = ‖sᵢ − r̄ᵢ‖, the pink segment.
- Average all gaps: CPST = mean(Eᵢ).
CPST = 1/N Σ ‖ si − (1/k) Σj∈Nk(i) rj ‖
This point: . Mean of all points:
04 / Hausdorff
Percentile Hausdorff distance: the largest local gap
Every point looks for its nearest neighbour on the other trajectory, in both directions. The classical Hausdorff distance keeps the single worst gap; the percentile version keeps the q-th percentile, so one bad sample cannot decide the result.
dH = max { Qq( minj ‖si − rj‖ ), Qq( mini ‖rj − si‖ ) }
05 / Results
Output
Both indices are in the units of the signal. Judge them against a healthy baseline, not zero: CPST has a small floor when k > 1, and noise raises both.
06 / Code
Same algorithm in Python
The psdist package reproduces this page and the values reported in the PECT study. MIT licence.
# pip install -r requirements.txt import psdist from psdist.mock import make_pair t, ref, test = make_pair("shape", severity=0.3) psdist.cpst(ref, test, tau=8, m=3, k=5) # 0.335 psdist.hausdorff(ref, test, tau=8, m=3, q=95) # 0.418
Reference
Cite this workPraphaphankul, N., Akutsu, A., Sasaki, E. Subsurface crack detection in asphalt-paved orthotropic steel bridge decks using pulsed eddy current testing and phase-space feature analysis (manuscript in preparation, 2026).
View on GitHub