M5Unit-HEART 0.1.0 git rev:05c3b01
Loading...
Searching...
No Matches
m5::heart::PulseMonitor Class Reference

Calculate BPM and SpO2, and detect the pulse beat. More...

#include <pulse_monitor.hpp>

Public Member Functions

 PulseMonitor (const uint32_t samplingRate=100, const uint32_t sec=5)
 Costructor.
 
bool isBeat () const
 Detect beat?
 
float bpm () const
 Gets the BPM.
 
float SpO2 () const
 Gets the SpO2.
 
void setSamplingRate (const uint32_t samplingRate)
 Set the sampling rate.
 
void push_back (const float ir)
 Push back IR.
 
void push_back (const float ir, const float red)
 Push back IR and RED.
 
void update ()
 Update status.
 
void clear ()
 Clear inner data.
 
float latestIR () const
 Filterd latest ir value.
 

Protected Member Functions

float calculate_bpm ()
 

Detailed Description

Calculate BPM and SpO2, and detect the pulse beat.

Constructor & Destructor Documentation

◆ PulseMonitor()

m5::heart::PulseMonitor::PulseMonitor ( const uint32_t samplingRate = 100,
const uint32_t sec = 5 )
inlineexplicit

Costructor.

Parameters
samplingRatesampling rate
secSeconds of data to be stored

Member Function Documentation

◆ push_back() [1/2]

void m5::heart::PulseMonitor::push_back ( const float ir)

Push back IR.

Parameters
irIR data

◆ push_back() [2/2]

void m5::heart::PulseMonitor::push_back ( const float ir,
const float red )

Push back IR and RED.

Parameters
irIR data
redRED data
Note
Calclate SpO2

◆ setSamplingRate()

void m5::heart::PulseMonitor::setSamplingRate ( const uint32_t samplingRate)

Set the sampling rate.

Parameters
samplingRatesampling rate
Note
clear stored data

◆ SpO2()

float m5::heart::PulseMonitor::SpO2 ( ) const
inline

Gets the SpO2.

Warning
IR and RED must be pushed back

◆ update()

void m5::heart::PulseMonitor::update ( )

Update status.

Note
Calclate BPM