Struct peakbag::PeakDetector [] [src]

pub struct PeakDetector<T: Copy> {
    // some fields omitted
}

Configurable struct for detecting peaks.

This structure allow for fine-grained adjustment of the peak detection procedures.

Methods

impl<T: Copy> PeakDetector<T>

fn new(width: usize, floor: T, ceiling: T) -> PeakDetector<T>

Creates a new peak detector.

Examples

use peakbag::PeakDetector;
let detector = PeakDetector::new(1, 2, 3);

fn saturation(self, saturation: T) -> PeakDetector<T>

Sets the saturation level for this peak detector.

Examples

use peakbag::PeakDetector;
let mut detector = PeakDetector::new(1, 2, 3).saturation(3);

fn min_height_above_background(self, min_height_above_background: f64) -> PeakDetector<T>

Sets the minimum allowable height above background for a peak.

Examples

use peakbag::PeakDetector;
let mut detector = PeakDetector::new(1, 2, 3).min_height_above_background(4.0);

fn max_kurtosis(self, max_kurtosis: f64) -> PeakDetector<T>

Sets the maximum allowable kurtosis for a peak.

Examples

use peakbag::PeakDetector;
let detector = PeakDetector::new(1, 2, 3).max_kurtosis(4.0);

impl<T> PeakDetector<T> where T: Copy + Display + PartialOrd + ToPrimitive + Unsigned

fn detect_peaks(&self, data: &[T]) -> Vec<Peak<T>>

Detects peaks in full waveform data.

Panics

Panics if a sample value cannot be converted to an i64 and f64.

Examples

use peakbag::PeakDetector;
let detector = PeakDetector::new(0, 8, 2);
let peaks = detector.detect_peaks(&[1u32, 2, 3, 2, 1]);

Trait Implementations

Derived Implementations

impl<T: Debug + Copy> Debug for PeakDetector<T>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<T: Copy + Copy> Copy for PeakDetector<T>

impl<T: Clone + Copy> Clone for PeakDetector<T>

fn clone(&self) -> PeakDetector<T>

fn clone_from(&mut self, source: &Self)