[][src]Struct qrs_detector::QrsDetector

pub struct QrsDetector<FMW, FB> where
    FMW: Size<f32>,
    FB: Size<f32>, 
{ /* fields omitted */ }

Find QRS complex in real-time sampled ECG signal.

Type parameters:

The QrsDetector is built upon generic_array. This has an unfortunate implementation detail where the internal buffer sizes must be set on the type level.

  • FMW - number of samples representing 350ms, as typenum::U*
  • FB - number of samples representing 50ms, as typenum::U*

These type parameters are checked at runtime and if incorrect and the error message will contain the correct sizes.

Implementations

impl<FMW, FB> QrsDetector<FMW, FB> where
    FMW: Size<f32>,
    FB: Size<f32>, 
[src]

pub fn new(fs: SamplingFrequency) -> Self[src]

Returns a new QRS detector for signals sampled at fs sampling frequency.

Arguments

  • fs - The sampling frequency of the processed signal. For more information see SamplingFrequencyExt.

Example

use qrs_detector::sampling::*;
use qrs_detector::QrsDetector;
use qrs_detector::typenum::{U150, U25};

// Assuming 500 samples per second
// Type parameters must be 300ms and 50ms in number of samples
let detector: QrsDetector<U150, U25> = QrsDetector::new(500.sps());

pub fn clear(&mut self)[src]

Reset the internal state of the detector

pub fn update(&mut self, sample: f32) -> Option<u32>[src]

Process a sample. Returns Some sample index if a QRS complex is detected.

Auto Trait Implementations

impl<FMW, FB> Send for QrsDetector<FMW, FB>

impl<FMW, FB> Sync for QrsDetector<FMW, FB>

impl<FMW, FB> Unpin for QrsDetector<FMW, FB> where
    <FB as ArrayLength<MaybeUninit<f32>>>::ArrayType: Unpin,
    <FMW as ArrayLength<MaybeUninit<f32>>>::ArrayType: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.