Skip to main content
. 2023 Feb 6;23(4):1824. doi: 10.3390/s23041824
Algorithm 1 For mitigation of the error shown in Figure 5
Input: Synchronised (Syn.) signal referred to as Correct_signal, Syn. signal referred to as the Incorrect_signal, window_length[sec], sampling_rate[Hz]
Output: Processed_Signal of the assumed faulty signal
total_signal_length ← LENGTH(Correct_signal)/sampling_rate
n ← CEILING (total_signal_length[sec]/window_length)
SPLIT Correct_signal into n nonoverlapping windows
SPLIT Incorrect_signal into n nonoverlapping windows
FOR each time window DO:
 Offset ← MEAN(current time window of Correct_signal) − MEAN(current time window of Incorrect_signal)
 Current time window of Processed_Signal ← Current time window of Incorrect_signal + Offset
 //Current time window of Processed_Signal is appended to the processed_signal below
 Processed_Signal ← STACK(Current time window of Processed_Signal)
END FOR