Skip to main content
. 2023 Feb 6;23(4):1824. doi: 10.3390/s23041824
Algorithm 2 For the mitigation of the signal discontinuities resulting from the pseudocode in Algorithm 1
Input: Processed_Signal (output from Pseudocode in Algorithm 1), Synchr. original signal referred to as Original_signal, window_length[sec], sampling_rate[Hz]
Output: Processed_Signal (eliminated jumps)
FOR each time window DO:
 start_idx ← index of the first data point of the current time window
 stop_idx ← index of the last data point of the current time window
moriginal ← (Original_signal [stop_idx + window_length/2)] − Original_signal [start_idx + window_length/2])/(stop_idx − start_idx)
mfiltered ← (Processed_Signal [stop_idx] − Processed_Signal [start_idx])/(end_idx − start_idx)
 theta ← by means of mfiltered and moriginal according to Equation (13)
ε ← Original_signal [(start_idx + 0.5 × window_length) to (stop_idx + 0.5 × window_length)]
εε − MEAN(ε)
 //VECTOR() generates an evenly spaced vector covering the specified range below
tε ← VECTOR(0 to LENGTH(ε) with increments of 1) − (LENGTH(ε)/2)
εrotated ← by means of ε, tε and theta according to Equation (14)
 Processed_Signal [start_idx to stop_idx] ← εrotated
END FOR