There is a bug in fiducials.py:
SUT_time = peaks[i]-temp_oi0 > min_SUT
DT_time = temp_oi0-peaks[i-1] > min_DT
this bug will make SQI.get_ppgSQI return a error occasionally.
peaks[i] is the next onset of a full PPG period, and temp_oi0 is the systolic peak of the current PPG period, peaks[i] is behind temp_oi0, in other words the peak[i] is bigger than temp_oi0, so their distance is corresponding to the diastolic segment, not the systolic segment.
It should be modified as:
SUT_time = peaks[i]-temp_oi0 > min_DT
DT_time = temp_oi0-peaks[i-1] > min_SUT
There is a bug in fiducials.py:
SUT_time = peaks[i]-temp_oi0 > min_SUT
DT_time = temp_oi0-peaks[i-1] > min_DT
this bug will make SQI.get_ppgSQI return a error occasionally.
peaks[i] is the next onset of a full PPG period, and temp_oi0 is the systolic peak of the current PPG period, peaks[i] is behind temp_oi0, in other words the peak[i] is bigger than temp_oi0, so their distance is corresponding to the diastolic segment, not the systolic segment.
It should be modified as:
SUT_time = peaks[i]-temp_oi0 > min_DT
DT_time = temp_oi0-peaks[i-1] > min_SUT