Speed up Wobble peak search with a linear maximum filter - #4782
JESUSROYETH wants to merge 1 commit into
Conversation
|
Looks great and promising ! Actually, the same argrelmax() should be also in place in circus.py for the OMP peeler, used in a similar manner. Maybe worth also optimizing to be consistent? |
|
Thanks @yger, good point on consistency... checking The only One detail: the criteria are not the same. On a flat plateau Circus can keep several tied samples, while this helper keeps the strict |
|
Ok my bad, I wasn't in front of a computer. I'll check the other matching engines, but yes, let's only change if they use argrelmax. I'll read everything more carefully later, thanks a lot ! |
Wobble calls
argrelmaxwithorder=num_samples - 1during chunked matching. When candidates remain, SciPy rescans the objective for each offset. So this uses two directionalmaximum_filter1dpasses while preserving strict maxima; arrays with NaN keep the original path.Five measured alternating baseline/candidate pairs on generated recordings; the VM harness discarded one setup run:
The baseline spent 14.76% of matching time in 308
argrelmaxcalls.The matching pairs were stable (+11.01–14.45%) and returned the same 28,043 spikes byte for byte. The full-sort pairs were also stable (+10.48–13.11%).
Final-code validation: 700 differential cases; ten byte-identical fixed-template runs; 9 focused tests; the public Wobble test; and formatting. Diff: 88 additions, 5 deletions.
The cold-sort result is corroborating, not equal-workload, because clustering is non-deterministic. The 384-channel full sort remains unvalidated: both arms failed during clustering, before matching, with an unknown singular-matrix cause. No captured recording was benchmarked.