Crates.io | topological_peak_detection |
lib.rs | topological_peak_detection |
version | 0.2.0 |
source | src |
created_at | 2022-05-15 14:06:02.733099 |
updated_at | 2022-05-15 14:57:49.539544 |
description | A mostly efficient topological algorithm for finding all peaks in a 1-D signal. |
homepage | |
repository | https://github.com/caseykneale/topological_peak_detection |
max_upload_size | |
id | 587175 |
size | 20,265 |
This crate finds peaks inside of 1-D signals (vectors of PartialOrd
satisfying types) using topological persistance.
Here's a simple example:
use core::f32::consts::PI;
...
let tst_vec:Vec<f32> = (0..6001)
.map(|x| ((x as f32 / 1000_f32) * PI).sin())
.collect();
let homologies = find_homologies(&tst_vec);
let x = get_peaks(&homologies);
// x == [500, 2500, 4500, 6000]