tof_dataclasses::analysis

Function find_peaks

Source
pub fn find_peaks(
    voltages: &Vec<f32>,
    nanoseconds: &Vec<f32>,
    start_time: f32,
    window_size: f32,
    min_peak_width: usize,
    threshold: f32,
    max_peaks: usize,
) -> Result<Vec<(usize, usize)>, WaveformError>
Expand description

Find peaks in a given time window (in ns) by comparing the waveform voltages with the given threshold.

#Arguments:

  • start_time : begin to look for peaks after this (local) waveform time
  • window_size : (in ns)
  • min_peak_width : minimum number of consequtive bins which have to be over threshold so that it is considered a peak
  • threshold : peaks are found when voltages go over threshold for at leas min_peak_width bins
  • max_peaks : stop algorithm after max_peaks are found, the rest will be ignored #Returns:

Vec<(peak_begin_bin, peak_end_bin)>