use-zero-crossing 0.0.1

Primitive zero-crossing helpers for signal slices
Documentation
  • Coverage
  • 25%
    1 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 4.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 254.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-signal
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Primitive zero-crossing helpers.

Exact zero values are treated as neutral samples: they do not create a crossing on their own, but they also do not break the sign continuity between surrounding non-zero finite samples.

Examples

use use_zero_crossing::{crosses_zero, zero_crossing_count, zero_crossing_rate};

let samples = [-1.0, 0.0, 1.0, -1.0];

assert!(crosses_zero(-1.0, 1.0));
assert_eq!(zero_crossing_count(&samples), 2);
assert_eq!(zero_crossing_rate(&samples), Some(2.0 / 3.0));