Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
spo2_algorithm.h
00001 #ifndef SPO2_ALGORITHM_H_ 00002 #define SPO2_ALGORITHM_H_ 00003 00004 #include "mbed.h" 00005 00006 #define FS 25 //sampling frequency 00007 #define BUFFER_SIZE (FS * 4) 00008 #define MA4_SIZE 4 // DONOT CHANGE 00009 #define HAMMING_SIZE 5 00010 #define min(x,y) ((x) < (y) ? (x) : (y)) //Defined in Arduino.h 00011 00012 #define true 1 00013 #define false 0 00014 //#define FS 100 00015 //#define BUFFER_SIZE (FS* 5) 00016 #define HR_FIFO_SIZE 7 00017 #define MA4_SIZE 4 // DO NOT CHANGE 00018 #define HAMMING_SIZE 5// DO NOT CHANGE 00019 #define min(x,y) ((x) < (y) ? (x) : (y)) 00020 00021 00022 class spo2_algorithm{ 00023 00024 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); 00025 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 ); 00026 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 ); 00027 void maxim_remove_close_peaks( int32_t *pn_locs, int32_t *pn_npks, int32_t *pn_x, int32_t n_min_distance ); 00028 void maxim_sort_ascend( int32_t *pn_x, int32_t n_size ); 00029 void maxim_sort_indices_descend( int32_t *pn_x, int32_t *pn_indx, int32_t n_size); 00030 }; 00031 #endif
Generated on Sun Aug 7 2022 17:01:46 by
1.7.2