zinnet yazıcı
/
max30105Example
maxrefdes117
Diff: spo2_algorithm.h
- Revision:
- 0:78a2573ad768
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spo2_algorithm.h Tue Aug 06 12:19:46 2019 +0000 @@ -0,0 +1,31 @@ +#ifndef SPO2_ALGORITHM_H_ +#define SPO2_ALGORITHM_H_ + +#include "mbed.h" + +#define FS 25 //sampling frequency +#define BUFFER_SIZE (FS * 4) +#define MA4_SIZE 4 // DONOT CHANGE +#define HAMMING_SIZE 5 +#define min(x,y) ((x) < (y) ? (x) : (y)) //Defined in Arduino.h + +#define true 1 +#define false 0 +//#define FS 100 +//#define BUFFER_SIZE (FS* 5) +#define HR_FIFO_SIZE 7 +#define MA4_SIZE 4 // DO NOT CHANGE +#define HAMMING_SIZE 5// DO NOT CHANGE +#define min(x,y) ((x) < (y) ? (x) : (y)) + + +class spo2_algorithm{ + +void maxim_heart_rate_and_oxygen_saturation(uint32_t *pun_ir_buffer , int32_t n_ir_buffer_length, uint32_t *pun_red_buffer , int32_t *pn_spo2, int8_t *pch_spo2_valid , int32_t *pn_heart_rate , int8_t *pch_hr_valid); +void maxim_find_peaks( int32_t *pn_locs, int32_t *pn_npks, int32_t *pn_x, int32_t n_size, int32_t n_min_height, int32_t n_min_distance, int32_t n_max_num ); +void maxim_peaks_above_min_height( int32_t *pn_locs, int32_t *pn_npks, int32_t *pn_x, int32_t n_size, int32_t n_min_height ); +void maxim_remove_close_peaks( int32_t *pn_locs, int32_t *pn_npks, int32_t *pn_x, int32_t n_min_distance ); +void maxim_sort_ascend( int32_t *pn_x, int32_t n_size ); +void maxim_sort_indices_descend( int32_t *pn_x, int32_t *pn_indx, int32_t n_size); +}; +#endif