Algorithm 1. Pseudocode of peak detection algorithm and feature detection for dataset D. |
FORin D (ECG or PPG data instance from dataset, where i = {0…size(D)) |
Filtered signal = BandpassFilter(
|
Let (Peak amplitudes) |
Let (Peak times) |
Let
|
Let
|
Set = Average ECG or PPG peak duration |
Set = Average ECG or PPG beat duration |
Set = MovingAverage(, ) |
Set = MovingAverage(, ) |
Set threshold =
|
FOR n = 1 to length() |
IF > THEN
|
|
ELSE |
|
END IF |
END FOR |
FOR j = 0 to length(BlocksOfInterest) |
IF THEN
|
= max(BlockOfInterest[j]) |
= time(BlockOfInterest[j]) |
ELSE; |
|
END IF |
END FOR |
Calculate HRV/PRV (peaklist, timelist) |
Transformed data instance = } |
Save to updated dataset
|
END FOR |