Skip to main content
. 2022 Dec 14;12(12):1170. doi: 10.3390/bios12121170
Algorithm 2 Estimation of the RR from the O2Hb signal’s baseline wander
Input:O2HB signal x(n), Troughs of O2HB signal K, and the length of moving average
filter L
Output:RR
1: m(n) Spline (K, x(K), 1 to length(x(n)))
2: MA1L× ones(L,1)
3: S(n) filtfilt(MA,1,m(n))
4: G(n)m(n)S(n)
5: [P,F] FFT (G(n))
6: r find(P(F) Max(P(F)))
7: RR r × 60
8: return  RR