maxrefdes117

Committer:
zinnetyazicii53
Date:
Tue Aug 06 12:19:46 2019 +0000
Revision:
0:78a2573ad768
commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
zinnetyazicii53 0:78a2573ad768 1 #ifndef SPO2_ALGORITHM_H_
zinnetyazicii53 0:78a2573ad768 2 #define SPO2_ALGORITHM_H_
zinnetyazicii53 0:78a2573ad768 3
zinnetyazicii53 0:78a2573ad768 4 #include "mbed.h"
zinnetyazicii53 0:78a2573ad768 5
zinnetyazicii53 0:78a2573ad768 6 #define FS 25 //sampling frequency
zinnetyazicii53 0:78a2573ad768 7 #define BUFFER_SIZE (FS * 4)
zinnetyazicii53 0:78a2573ad768 8 #define MA4_SIZE 4 // DONOT CHANGE
zinnetyazicii53 0:78a2573ad768 9 #define HAMMING_SIZE 5
zinnetyazicii53 0:78a2573ad768 10 #define min(x,y) ((x) < (y) ? (x) : (y)) //Defined in Arduino.h
zinnetyazicii53 0:78a2573ad768 11
zinnetyazicii53 0:78a2573ad768 12 #define true 1
zinnetyazicii53 0:78a2573ad768 13 #define false 0
zinnetyazicii53 0:78a2573ad768 14 //#define FS 100
zinnetyazicii53 0:78a2573ad768 15 //#define BUFFER_SIZE (FS* 5)
zinnetyazicii53 0:78a2573ad768 16 #define HR_FIFO_SIZE 7
zinnetyazicii53 0:78a2573ad768 17 #define MA4_SIZE 4 // DO NOT CHANGE
zinnetyazicii53 0:78a2573ad768 18 #define HAMMING_SIZE 5// DO NOT CHANGE
zinnetyazicii53 0:78a2573ad768 19 #define min(x,y) ((x) < (y) ? (x) : (y))
zinnetyazicii53 0:78a2573ad768 20
zinnetyazicii53 0:78a2573ad768 21
zinnetyazicii53 0:78a2573ad768 22 class spo2_algorithm{
zinnetyazicii53 0:78a2573ad768 23
zinnetyazicii53 0:78a2573ad768 24 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);
zinnetyazicii53 0:78a2573ad768 25 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 );
zinnetyazicii53 0:78a2573ad768 26 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 );
zinnetyazicii53 0:78a2573ad768 27 void maxim_remove_close_peaks( int32_t *pn_locs, int32_t *pn_npks, int32_t *pn_x, int32_t n_min_distance );
zinnetyazicii53 0:78a2573ad768 28 void maxim_sort_ascend( int32_t *pn_x, int32_t n_size );
zinnetyazicii53 0:78a2573ad768 29 void maxim_sort_indices_descend( int32_t *pn_x, int32_t *pn_indx, int32_t n_size);
zinnetyazicii53 0:78a2573ad768 30 };
zinnetyazicii53 0:78a2573ad768 31 #endif