![]() |
MAXREFDES117# Code Documentation
V01.00
Heart Rate / SpO2 Monitor
|
#include "mbed.h"
Go to the source code of this file.
Macros | |
#define | true 1 |
#define | false 0 |
#define | FS 100 |
#define | BUFFER_SIZE (FS* 5) |
#define | HR_FIFO_SIZE 7 |
#define | MA4_SIZE 4 |
#define | HAMMING_SIZE 5 |
#define | min(x, y) ((x) < (y) ? (x) : (y)) |
Functions | |
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) |
Calculate the heart rate and SpO2 level. | |
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) |
Find peaks. | |
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) |
Find peaks above 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) |
Remove peaks. | |
void | maxim_sort_ascend (int32_t *pn_x, int32_t n_size) |
Sort array. | |
void | maxim_sort_indices_descend (int32_t *pn_x, int32_t *pn_indx, int32_t n_size) |
Sort indices. | |
Variables | |
const uint16_t | auw_hamm [31] ={ 41, 276, 512, 276, 41 } |
const uint8_t | uch_spo2_table [184] |
******************************************************
Project: MAXREFDES117# Filename: algorithm.h Description: This module is the heart rate/SpO2 calculation algorithm header file
Revision History:
1-18-2016 Rev 01.00 SK Initial release.
This code follows the following naming conventions:
char ch_pmod_value
char (array) s_pmod_s_string[16]
float f_pmod_value
int32_t n_pmod_value
int32_t (array) an_pmod_value[16]
int16_t w_pmod_value
int16_t (array) aw_pmod_value[16]
uint16_t uw_pmod_value
uint16_t (array) auw_pmod_value[16]
uint8_t uch_pmod_value
uint8_t (array) auch_pmod_buffer[16]
uint32_t un_pmod_value
int32_t * pn_pmod_value
Definition in file algorithm.h.
#define BUFFER_SIZE (FS* 5) |
Definition at line 70 of file algorithm.h.
#define false 0 |
Definition at line 68 of file algorithm.h.
#define FS 100 |
Definition at line 69 of file algorithm.h.
#define HAMMING_SIZE 5 |
Definition at line 73 of file algorithm.h.
#define HR_FIFO_SIZE 7 |
Definition at line 71 of file algorithm.h.
#define MA4_SIZE 4 |
Definition at line 72 of file algorithm.h.
#define min | ( | x, | |
y | |||
) | ((x) < (y) ? (x) : (y)) |
Definition at line 74 of file algorithm.h.
#define true 1 |
Definition at line 67 of file algorithm.h.
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 | ||
) |
Find peaks.
None |
Definition at line 254 of file algorithm.cpp.
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 | ||
) |
Calculate the heart rate and SpO2 level.
[in] | *pun_ir_buffer | - IR sensor data buffer |
[in] | n_ir_buffer_length | - IR sensor data buffer length |
[in] | *pun_red_buffer | - Red sensor data buffer |
[out] | *pn_spo2 | - Calculated SpO2 value |
[out] | *pch_spo2_valid | - 1 if the calculated SpO2 value is valid |
[out] | *pn_heart_rate | - Calculated heart rate value |
[out] | *pch_hr_valid | - 1 if the calculated heart rate value is valid |
None |
Definition at line 62 of file algorithm.cpp.
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 | ||
) |
Find peaks above n_min_height.
None |
Definition at line 268 of file algorithm.cpp.
void maxim_remove_close_peaks | ( | int32_t * | pn_locs, |
int32_t * | pn_npks, | ||
int32_t * | pn_x, | ||
int32_t | n_min_distance | ||
) |
Remove peaks.
None |
Definition at line 299 of file algorithm.cpp.
void maxim_sort_ascend | ( | int32_t * | pn_x, |
int32_t | n_size | ||
) |
Sort array.
None |
Definition at line 328 of file algorithm.cpp.
void maxim_sort_indices_descend | ( | int32_t * | pn_x, |
int32_t * | pn_indx, | ||
int32_t | n_size | ||
) |
Sort indices.
None |
Definition at line 346 of file algorithm.cpp.
const uint16_t auw_hamm[31] ={ 41, 276, 512, 276, 41 } |
Definition at line 76 of file algorithm.h.
const uint8_t uch_spo2_table[184] |
Definition at line 78 of file algorithm.h.